Fixed spell registry wiping out existing nbt when enchanting a stack

This commit is contained in:
Sollace 2019-02-15 17:28:10 +02:00
parent 45d5840f82
commit 7abd4cbae6

View file

@ -127,7 +127,9 @@ public class SpellRegistry {
} }
public ItemStack enchantStack(ItemStack stack, String name) { public ItemStack enchantStack(ItemStack stack, String name) {
stack.setTagCompound(new NBTTagCompound()); if (!stack.hasTagCompound()) {
stack.setTagCompound(new NBTTagCompound());
}
stack.getTagCompound().setString("spell", name); stack.getTagCompound().setString("spell", name);
return stack; return stack;