Example #1
0
 public override void ReadFromNBT(net.minecraft.src.NBTTagCompound nbttagcompound)
 {
     base.ReadFromNBT(nbttagcompound);
     storedBlockID     = nbttagcompound.GetInteger("blockId");
     storedMetadata    = nbttagcompound.GetInteger("blockData");
     storedOrientation = nbttagcompound.GetInteger("facing");
     lastProgress      = progress = nbttagcompound.GetFloat("progress");
     isExtending       = nbttagcompound.GetBoolean("extending");
 }
Example #2
0
 public virtual void ReadFromNBT(net.minecraft.src.NBTTagCompound nbttagcompound)
 {
     //TODO: Bukkit stuff???
     net.minecraft.src.NBTTagList nbttaglist  = nbttagcompound.GetTagList("Pos");
     net.minecraft.src.NBTTagList nbttaglist1 = nbttagcompound.GetTagList("Motion");
     net.minecraft.src.NBTTagList nbttaglist2 = nbttagcompound.GetTagList("Rotation");
     motionX = ((net.minecraft.src.NBTTagDouble)nbttaglist1.TagAt(0)).doubleValue;
     motionY = ((net.minecraft.src.NBTTagDouble)nbttaglist1.TagAt(1)).doubleValue;
     motionZ = ((net.minecraft.src.NBTTagDouble)nbttaglist1.TagAt(2)).doubleValue;
     if (System.Math.Abs(motionX) > 10D)
     {
         motionX = 0.0D;
     }
     if (System.Math.Abs(motionY) > 10D)
     {
         motionY = 0.0D;
     }
     if (System.Math.Abs(motionZ) > 10D)
     {
         motionZ = 0.0D;
     }
     prevPosX = lastTickPosX = posX = ((net.minecraft.src.NBTTagDouble)nbttaglist.TagAt
                                           (0)).doubleValue;
     prevPosY = lastTickPosY = posY = ((net.minecraft.src.NBTTagDouble)nbttaglist.TagAt
                                           (1)).doubleValue;
     prevPosZ = lastTickPosZ = posZ = ((net.minecraft.src.NBTTagDouble)nbttaglist.TagAt
                                           (2)).doubleValue;
     prevRotationYaw = rotationYaw = ((net.minecraft.src.NBTTagFloat)nbttaglist2.TagAt
                                          (0)).floatValue;
     prevRotationPitch = rotationPitch = ((net.minecraft.src.NBTTagFloat)nbttaglist2.TagAt
                                              (1)).floatValue;
     fallDistance = nbttagcompound.GetFloat("FallDistance");
     fire         = nbttagcompound.GetShort("Fire");
     air          = nbttagcompound.GetShort("Air");
     onGround     = nbttagcompound.GetBoolean("OnGround");
     SetPosition(posX, posY, posZ);
     SetRotation(rotationYaw, rotationPitch);
     ReadEntityFromNBT(nbttagcompound);
 }