mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-08-05 05:13:54 +00:00
Fix crash when lectern has no item
This should never happen in practice, but might happen when using /setblock or after world corruption, so let's be careful here. Closes #2014
This commit is contained in:
parent
1d7d8006d4
commit
cddb8fec11
@ -119,7 +119,7 @@ public final class CustomLecternBlockEntity extends BlockEntity implements MenuP
|
|||||||
@Override
|
@Override
|
||||||
public CompoundTag getUpdateTag() {
|
public CompoundTag getUpdateTag() {
|
||||||
var tag = super.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;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user