Skip to content

Commit 4371fd7

Browse files
committed
fix log spam caused by empty item stacks in NbtUtil.readItemStackList
1 parent b5a115c commit 4371fd7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/main/java/io/wispforest/affinity/misc/util/NbtUtil.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ public static void readItemStackList(NbtCompound nbt, String key, DefaultedList<
3636
var stackNbt = (NbtCompound) element;
3737
byte idx = stackNbt.contains("Slot", NbtElement.BYTE_TYPE) ? stackNbt.getByte("Slot") : -1;
3838

39-
if (idx >= 0 && idx < items.size()) items.set(idx, ItemStack.fromNbtOrEmpty(registries, stackNbt));
39+
if (stackNbt.contains("id") && idx >= 0 && idx < items.size()) {
40+
items.set(idx, ItemStack.fromNbtOrEmpty(registries, stackNbt));
41+
}
4042
}
4143
}
4244

0 commit comments

Comments
 (0)