From 2ad2b9988b4bf6b65332689b6ffafb58285c8df9 Mon Sep 17 00:00:00 2001 From: Electroblob <35599699+Electroblob77@users.noreply.github.com> Date: Sun, 25 Feb 2018 18:44:46 +0000 Subject: [PATCH] Fix NBT copying for metamorphosis --- src/main/java/electroblob/wizardry/spell/Metamorphosis.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/electroblob/wizardry/spell/Metamorphosis.java b/src/main/java/electroblob/wizardry/spell/Metamorphosis.java index 28e097f9..0b0de703 100644 --- a/src/main/java/electroblob/wizardry/spell/Metamorphosis.java +++ b/src/main/java/electroblob/wizardry/spell/Metamorphosis.java @@ -33,6 +33,7 @@ import net.minecraft.entity.passive.EntityMooshroom; import net.minecraft.entity.passive.EntityPig; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumAction; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumHand; import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.math.Vec3d; @@ -101,7 +102,9 @@ public class Metamorphosis extends Spell { if(!world.isRemote){ // Transfers attributes from the old entity to the new one. newEntity.setHealth(((EntityLivingBase)entityHit).getHealth()); - newEntity.readFromNBT(entityHit.getEntityData()); + NBTTagCompound tag = new NBTTagCompound(); + entityHit.writeToNBT(tag); + newEntity.readFromNBT(tag); entityHit.setDead(); newEntity.setPosition(xPos, yPos, zPos);