empty book is treated as empty
This commit is contained in:
parent
611440cc01
commit
6af49dd1c8
1 changed files with 3 additions and 0 deletions
|
@ -172,6 +172,9 @@ public class ItemSpellbook extends Item implements DataHolderItem {
|
|||
tag.getCompound(TAG_SEALED).remove(key);
|
||||
} else
|
||||
tag.getCompound(TAG_PAGES).put(key, datum.serializeToNBT());
|
||||
|
||||
if (tag.getCompound(TAG_PAGES).isEmpty())
|
||||
tag.remove(TAG_SELECTED_PAGE);
|
||||
} else if (datum != null) {
|
||||
var pagesTag = new CompoundTag();
|
||||
pagesTag.put(key, datum.serializeToNBT());
|
||||
|
|
Loading…
Reference in a new issue