/** Reads the entity from NBT (calls an abstract helper method to read specialized data) */ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { NBTTagList nbttaglist = par1NBTTagCompound.getTagList("Pos"); NBTTagList nbttaglist1 = par1NBTTagCompound.getTagList("Motion"); NBTTagList nbttaglist2 = par1NBTTagCompound.getTagList("Rotation"); motionX = ((NBTTagDouble) nbttaglist1.tagAt(0)).data; motionY = ((NBTTagDouble) nbttaglist1.tagAt(1)).data; motionZ = ((NBTTagDouble) nbttaglist1.tagAt(2)).data; if (Math.abs(motionX) > 10D) { motionX = 0.0D; } if (Math.abs(motionY) > 10D) { motionY = 0.0D; } if (Math.abs(motionZ) > 10D) { motionZ = 0.0D; } prevPosX = lastTickPosX = posX = ((NBTTagDouble) nbttaglist.tagAt(0)).data; prevPosY = lastTickPosY = posY = ((NBTTagDouble) nbttaglist.tagAt(1)).data; prevPosZ = lastTickPosZ = posZ = ((NBTTagDouble) nbttaglist.tagAt(2)).data; prevRotationYaw = rotationYaw = ((NBTTagFloat) nbttaglist2.tagAt(0)).data; prevRotationPitch = rotationPitch = ((NBTTagFloat) nbttaglist2.tagAt(1)).data; fallDistance = par1NBTTagCompound.getFloat("FallDistance"); fire = par1NBTTagCompound.getShort("Fire"); setAir(par1NBTTagCompound.getShort("Air")); onGround = par1NBTTagCompound.getBoolean("OnGround"); setPosition(posX, posY, posZ); setRotation(rotationYaw, rotationPitch); readEntityFromNBT(par1NBTTagCompound); }