From 26fbda8b76bbb5545927f99a97af0f5aec5f7bab Mon Sep 17 00:00:00 2001 From: Sollace Date: Sun, 13 Jan 2019 22:06:54 +0200 Subject: [PATCH] Fixed spell registry leaving empty nbt tags on unenchanted items --- .../java/com/minelittlepony/unicopia/spell/SpellRegistry.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/minelittlepony/unicopia/spell/SpellRegistry.java b/src/main/java/com/minelittlepony/unicopia/spell/SpellRegistry.java index 79b9731d..4842ae1f 100644 --- a/src/main/java/com/minelittlepony/unicopia/spell/SpellRegistry.java +++ b/src/main/java/com/minelittlepony/unicopia/spell/SpellRegistry.java @@ -87,6 +87,10 @@ public class SpellRegistry { public ItemStack disenchantStack(ItemStack stack) { if (stackHasEnchantment(stack)) { stack.getTagCompound().removeTag("spell"); + + if (stack.getTagCompound().isEmpty()) { + stack.setTagCompound(null); + } } return stack;