Skip to content

Commit

Permalink
fix log spam caused by empty item stacks in NbtUtil.readItemStackList
Browse files Browse the repository at this point in the history
  • Loading branch information
gliscowo committed Dec 9, 2024
1 parent b5a115c commit 4371fd7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/io/wispforest/affinity/misc/util/NbtUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ public static void readItemStackList(NbtCompound nbt, String key, DefaultedList<
var stackNbt = (NbtCompound) element;
byte idx = stackNbt.contains("Slot", NbtElement.BYTE_TYPE) ? stackNbt.getByte("Slot") : -1;

if (idx >= 0 && idx < items.size()) items.set(idx, ItemStack.fromNbtOrEmpty(registries, stackNbt));
if (stackNbt.contains("id") && idx >= 0 && idx < items.size()) {
items.set(idx, ItemStack.fromNbtOrEmpty(registries, stackNbt));
}
}
}

Expand Down

0 comments on commit 4371fd7

Please sign in to comment.