diff --git a/BauSystem_15/src/de/steamwar/bausystem/features/world/InventoryListener_15.java b/BauSystem_15/src/de/steamwar/bausystem/features/world/InventoryListener_15.java index 06d5e8cf..7160055c 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/features/world/InventoryListener_15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/features/world/InventoryListener_15.java @@ -27,6 +27,8 @@ import org.bukkit.inventory.ItemStack; public class InventoryListener_15 { + private static final int threshold = 2048; + public static boolean checkItemStack(ItemStack item) { net.minecraft.server.v1_15_R1.ItemStack nmsItem = CraftItemStack.asNMSCopy(item); NBTTagCompound tag = nmsItem.getTag(); @@ -34,13 +36,13 @@ public class InventoryListener_15 { NBTTagCompound blockTag = tag.getCompound("BlockEntityTag"); assert blockTag != null; if (blockTag.hasKey("Items")) { - return drillDown(blockTag.getList("Items", 10), 0, 0) > 1024; + return drillDown(blockTag.getList("Items", 10), 0, 0) > threshold; } return false; } private static int drillDown(NBTTagList items, int layer, int start) { - if (layer > 2) return start + 1024; + if (layer > 2) return start + threshold; int invalid = start; for (NBTBase nbtBase : items) { if (!(nbtBase instanceof NBTTagCompound)) @@ -56,7 +58,7 @@ public class InventoryListener_15 { } } } - if (invalid > 1024) + if (invalid > threshold) break; } return invalid;