empty book is treated as empty

This commit is contained in:
yrsegal@gmail.com 2022-04-23 21:32:02 -04:00
parent 611440cc01
commit 6af49dd1c8

View file

@ -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());