/** * 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, damage, and NBT. */ public static boolean itemsEqualWithMetadata(ItemStack stackA, ItemStack stackB, boolean checkNBT) { return itemsEqualWithMetadata(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 boolean matches(ItemStack stack) { boolean ret = flags[IFilterable.FLAG_WHITELIST]; if (flags[IFilterable.FLAG_ORE_DICT] && !oreIDs.isEmpty()) { List<Integer> ids = ItemHelper.oreProxy.getAllOreIDs(stack); for (Integer i : ids) { if (oreIDs.contains(i)) { return ret; } } } for (ItemStack item : items) { if (item.getItem() != stack.getItem()) { continue; } if (flags[IFilterable.FLAG_METADATA] && item.getItemDamage() != stack.getItemDamage()) { continue; } if (flags[IFilterable.FLAG_NBT] && !ItemHelper.doNBTsMatch(item.getTagCompound(), stack.getTagCompound())) { continue; } return ret; } return !ret; }
continue; if (!flags[flagIgnoreNBT] && !ItemHelper.doNBTsMatch(item.getTagCompound(), filter.getTagCompound())) { continue;