Skip to content

Commit

Permalink
Fix crash when lectern has no item
Browse files Browse the repository at this point in the history
This should never happen in practice, but might happen when using
/setblock or after world corruption, so let's be careful here.

Closes #2014
  • Loading branch information
SquidDev committed Nov 19, 2024
1 parent 1d7d800 commit cddb8fe
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public Packet<ClientGamePacketListener> getUpdatePacket() {
@Override
public CompoundTag getUpdateTag() {
var tag = super.getUpdateTag();
tag.put(NBT_ITEM, item.save(new CompoundTag()));
if (!item.isEmpty()) tag.put(NBT_ITEM, item.save(new CompoundTag()));
return tag;
}

Expand Down

0 comments on commit cddb8fe

Please sign in to comment.