From 7abd4cbae6947c041c8a706155995e7101fb6e5c Mon Sep 17 00:00:00 2001 From: Sollace Date: Fri, 15 Feb 2019 17:28:10 +0200 Subject: [PATCH] Fixed spell registry wiping out existing nbt when enchanting a stack --- .../java/com/minelittlepony/unicopia/spell/SpellRegistry.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/minelittlepony/unicopia/spell/SpellRegistry.java b/src/main/java/com/minelittlepony/unicopia/spell/SpellRegistry.java index ae51fb51..5577075b 100644 --- a/src/main/java/com/minelittlepony/unicopia/spell/SpellRegistry.java +++ b/src/main/java/com/minelittlepony/unicopia/spell/SpellRegistry.java @@ -127,7 +127,9 @@ public class SpellRegistry { } public ItemStack enchantStack(ItemStack stack, String name) { - stack.setTagCompound(new NBTTagCompound()); + if (!stack.hasTagCompound()) { + stack.setTagCompound(new NBTTagCompound()); + } stack.getTagCompound().setString("spell", name); return stack;