/** * Determine if two ItemStacks have the same Item and damage. */ public static boolean itemsEqualWithMetadata(ItemStack stackA, ItemStack stackB) { return itemsEqualWithoutMetadata(stackA, stackB) && itemsDamageEqual(stackA, stackB); }
/** * Determine if two ItemStacks have the same Item and NBT. */ public static boolean itemsEqualWithoutMetadata(ItemStack stackA, ItemStack stackB, boolean checkNBT) { return itemsEqualWithoutMetadata(stackA, stackB) && (!checkNBT || doNBTsMatch(stackA.getTagCompound(), stackB.getTagCompound())); }
/** * Determine if two ItemStacks have the same Item, identical damage, and NBT. */ public static boolean itemsIdentical(ItemStack stackA, ItemStack stackB) { return itemsEqualWithoutMetadata(stackA, stackB) && getItemDamage(stackA) == getItemDamage(stackB) && doNBTsMatch(stackA.getTagCompound(), stackB.getTagCompound()); }
public static boolean itemsEqualForCrafting(ItemStack stackA, ItemStack stackB) { return itemsEqualWithoutMetadata(stackA, stackB) && (!stackA.getHasSubtypes() || ((getItemDamage(stackA) == OreDictionary.WILDCARD_VALUE || getItemDamage(stackB) == OreDictionary.WILDCARD_VALUE) || getItemDamage(stackB) == getItemDamage(stackA))); }