Camera Mod

Camera Mod

16M Downloads

Lectern Mixin adds NBT to the EMPTY stack

Buuz135 opened this issue ยท 3 comments

commented

When a lectern is loaded (from a village for a example) the ItemStack.EMPTY gets the image NBT, probably cause by this https://github.com/henkelmax/camera/blob/master/src/main/java/de/maxhenkel/camera/mixins/LecternTileEntityMixin.java#L88

It might also happen in the other methods.

Versions

  • Minecraft version: 1.18
  • Forge version: 39.0.09
  • Mod version: 1.0.0
commented

Thanks for reporting this issue!
I additionally added some asserts, so this hopefully won't happen again.

commented

It is also highly advisable to avoid getOrCreateTag() for operations without write/mutation intent like in

CompoundTag compound = stack.getOrCreateTag();
and instead use getTag and check the result for null.

commented

It is used to modify the tag in most cases.