Merge pull request #1478 from yueh/fix-1465
Fixes #1465 faulty item comparison
This commit is contained in:
commit
ecf2f3fdaf
3 changed files with 9 additions and 6 deletions
|
@ -85,7 +85,10 @@ public final class WrappedDamageItemDefinition implements ITileDefinition
|
|||
return false;
|
||||
}
|
||||
|
||||
return this.definition.isSameAs( comparableStack ) && comparableStack.getItemDamage() == this.damage;
|
||||
final boolean sameItem = this.definition.isSameAs( new ItemStack( comparableStack.getItem() ) );
|
||||
final boolean sameDamage = comparableStack.getItemDamage() == this.damage;
|
||||
|
||||
return sameItem && sameDamage;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1859,15 +1859,15 @@ public class Platform
|
|||
return null;
|
||||
}
|
||||
|
||||
public static boolean isSameItemType( ItemStack ol, ItemStack op )
|
||||
public static boolean isSameItemType( ItemStack that, ItemStack other )
|
||||
{
|
||||
if( ol != null && op != null && ol.getItem() == op.getItem() )
|
||||
if( that != null && other != null && that.getItem() == other.getItem() )
|
||||
{
|
||||
if( ol.isItemStackDamageable() )
|
||||
if( that.isItemStackDamageable() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return ol.getItemDamage() == ol.getItemDamage();
|
||||
return that.getItemDamage() == other.getItemDamage();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue