diff --git a/src/main/java/storagecraft/storage/StorageItem.java b/src/main/java/storagecraft/storage/StorageItem.java index 48ce1d78c..bf253dc96 100644 --- a/src/main/java/storagecraft/storage/StorageItem.java +++ b/src/main/java/storagecraft/storage/StorageItem.java @@ -133,10 +133,18 @@ public class StorageItem if ((flags & InventoryUtils.COMPARE_NBT) == InventoryUtils.COMPARE_NBT) { - if (tag != null && !tag.equals(other.getTag())) + if ((tag != null && other.getTag() == null) || (tag == null && other.getTag() != null)) { return false; } + + if (tag != null && other.getTag() != null) + { + if (!tag.equals(other.getTag())) + { + return false; + } + } } if ((flags & InventoryUtils.COMPARE_QUANTITY) == InventoryUtils.COMPARE_QUANTITY) @@ -162,10 +170,18 @@ public class StorageItem if ((flags & InventoryUtils.COMPARE_NBT) == InventoryUtils.COMPARE_NBT) { - if (tag != null && !tag.equals(stack.getTagCompound())) + if ((tag != null && stack.getTagCompound() == null) || (tag == null && stack.getTagCompound() != null)) { return false; } + + if (tag != null && stack.getTagCompound() != null) + { + if (!tag.equals(stack.getTagCompound())) + { + return false; + } + } } if ((flags & InventoryUtils.COMPARE_QUANTITY) == InventoryUtils.COMPARE_QUANTITY)