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:
parent
01c4767727
commit
365d9a27d6
1 changed files with 3 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue