From d9ebd3fb536f790f40d6277c9f3cdfed38d0c114 Mon Sep 17 00:00:00 2001 From: LexManos Date: Sat, 23 Feb 2013 11:22:01 -0800 Subject: [PATCH] Change usage of ketSet/get to entrySet in OreDictionary, closes #422 --- .../minecraftforge/oredict/OreDictionary.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/common/net/minecraftforge/oredict/OreDictionary.java b/common/net/minecraftforge/oredict/OreDictionary.java index 911a8ebe4..b3faa098d 100644 --- a/common/net/minecraftforge/oredict/OreDictionary.java +++ b/common/net/minecraftforge/oredict/OreDictionary.java @@ -184,15 +184,19 @@ public class OreDictionary */ public static int getOreID(ItemStack itemStack) { - if( itemStack == null ) - return -1; - - for(int oreID : oreStacks.keySet()) + if (itemStack == null) { - for(ItemStack target : oreStacks.get(oreID)) + return -1; + } + + for(Entry> ore : oreStacks.entrySet()) + { + for(ItemStack target : ore.getValue()) { if(itemStack.itemID == target.itemID && (target.getItemDamage() == -1 || itemStack.getItemDamage() == target.getItemDamage())) - return oreID; + { + return ore.getKey(); + } } } return -1; // didn't find it.