fix bug where StorageItem compared NBT badly with null
This commit is contained in:
		| @@ -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) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Raoul Van den Berge
					Raoul Van den Berge