Change usage of ketSet/get to entrySet in OreDictionary, closes #422
This commit is contained in:
parent
3945819851
commit
d9ebd3fb53
1 changed files with 10 additions and 6 deletions
|
@ -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<Integer, ArrayList<ItemStack>> 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.
|
||||
|
|
Loading…
Reference in a new issue