Transceiver item buffers would allow multiple non-stackable items of the same type

This commit is contained in:
CrazyPants committed 2014-10-30 11:12:13 +08:00
1 parent ac8b7c3493
commit e425a8e370
4 files changed
+28 -11

No files matched your search

+18 -2
View File
@@ -164,14 +164,30 @@ public class ItemUtil {
return inv;
}
/**
* Checks if items, damage and NBT are equal and the items are stackable.
* @param s1
* @param s2
* @return
*/
public static boolean areStackMergable(ItemStack s1, ItemStack s2) {
if(s1 == null || s2 == null || !s1.isStackable() || !s2.isStackable()) {
return false;
}
if(!s1.isItemEqual(s2)) {
return false;
}
return ItemStack.areItemStackTagsEqual(s1, s2);
}
/**
* Checks if items, damage and NBT are equal.
* @param s1
* @param s2
* @return
*/
public static boolean areStackTypesEqual(ItemStack s1, ItemStack s2) {
if(s1 == null || s2 == null || !s1.isStackable() || !s2.isStackable()) {
public static boolean areStacksEqual(ItemStack s1, ItemStack s2) {
if(s1 == null || s2 == null) {
return false;
}
if(!s1.isItemEqual(s2)) {