Fix determination of crafting equivalency.

Items can be registered with multiple ore ids in the OreDictionary. A direct comparison of the ore ids may fail in that case.
This commit is contained in:
SirSengir 2013-06-28 20:05:48 +02:00
parent 01c4767727
commit 365d9a27d6

View file

@ -87,10 +87,9 @@ public class StackHelper {
if (oreDictionary) {
int idBase = OreDictionary.getOreID(base);
if (idBase >= 0) {
int idComp = OreDictionary.getOreID(comparison);
if (idComp >= 0) {
if (idBase == idComp)
return true;
for(ItemStack itemstack : OreDictionary.getOres(idBase)) {
if(comparison.itemID == itemstack.itemID && (itemstack.getItemDamage() == OreDictionary.WILDCARD_VALUE || comparison.getItemDamage() == itemstack.getItemDamage()))
return true;
}
}
}