diff --git a/src/main/java/team/lodestar/lodestone/systems/blockentity/LodestoneBlockEntityInventory.java b/src/main/java/team/lodestar/lodestone/systems/blockentity/LodestoneBlockEntityInventory.java index d205399f..2f8761b3 100644 --- a/src/main/java/team/lodestar/lodestone/systems/blockentity/LodestoneBlockEntityInventory.java +++ b/src/main/java/team/lodestar/lodestone/systems/blockentity/LodestoneBlockEntityInventory.java @@ -95,7 +95,14 @@ public void updateData() { nonEmptyItemStacks = stacks.stream().filter(s -> !s.isEmpty()).collect(Collectors.toCollection(ArrayList::new)); nonEmptyItemAmount = nonEmptyItemStacks.size(); emptyItemAmount = (int) stacks.stream().filter(ItemStack::isEmpty).count(); - firstEmptyItemIndex = this.stacks.indexOf(ItemStack.EMPTY); + for (int i = 0; i < stacks.size(); i++) { + ItemStack stack = stacks.get(i); + if (stack.isEmpty()) { + firstEmptyItemIndex = i; + return; + } + } + firstEmptyItemIndex = -1; } public void load(CompoundTag compound) {