Example #1
0
        protected internal override void ReadEntityFromNBT(net.minecraft.src.NBTTagCompound
                                                           nbttagcompound)
        {
            base.ReadEntityFromNBT(nbttagcompound);
            SetIsAngry(nbttagcompound.GetBoolean("Angry"));
            SetIsSitting(nbttagcompound.GetBoolean("Sitting"));
            string s = nbttagcompound.GetString("Owner");

            if (s.Length > 0)
            {
                SetOwner(s);
                SetIsTamed(true);
            }
        }
Example #2
0
 protected internal override void ReadEntityFromNBT(net.minecraft.src.NBTTagCompound
                                                    nbttagcompound)
 {
     base.ReadEntityFromNBT(nbttagcompound);
     SetSheared(nbttagcompound.GetBoolean("Sheared"));
     SetFleeceColor(nbttagcompound.GetByte("Color"));
 }
Example #3
0
 protected internal override void ReadEntityFromNBT(net.minecraft.src.NBTTagCompound
                                                    nbttagcompound)
 {
     base.ReadEntityFromNBT(nbttagcompound);
     dataWatcher.UpdateObject(17, unchecked ((byte)(nbttagcompound.GetBoolean
                                                        ("powered") ? 1 : 0)));
 }
Example #4
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 #5
0
 protected internal override void ReadEntityFromNBT(net.minecraft.src.NBTTagCompound
                                                    nbttagcompound)
 {
     xTile         = nbttagcompound.GetShort("xTile");
     yTile         = nbttagcompound.GetShort("yTile");
     zTile         = nbttagcompound.GetShort("zTile");
     inTile        = nbttagcompound.GetByte("inTile");
     field_28011_h = nbttagcompound.GetByte("inData");
     arrowShake    = nbttagcompound.GetByte("shake");
     inGround      = nbttagcompound.GetByte("inGround") == 1;
     field_28012_a = nbttagcompound.GetBoolean("player");
 }
Example #6
0
 public WorldInfo(net.minecraft.src.NBTTagCompound nbttagcompound)
 {
     // Referenced classes of package net.minecraft.src:
     //            NBTTagCompound, EntityPlayer
     randomSeed     = nbttagcompound.GetLong("RandomSeed");
     spawnX         = nbttagcompound.GetInteger("SpawnX");
     spawnY         = nbttagcompound.GetInteger("SpawnY");
     spawnZ         = nbttagcompound.GetInteger("SpawnZ");
     worldTime      = nbttagcompound.GetLong("Time");
     lastTimePlayed = nbttagcompound.GetLong("LastPlayed");
     sizeOnDisk     = nbttagcompound.GetLong("SizeOnDisk");
     levelName      = nbttagcompound.GetString("LevelName");
     saveVersion    = nbttagcompound.GetInteger("version");
     rainTime       = nbttagcompound.GetInteger("rainTime");
     isRaining      = nbttagcompound.GetBoolean("raining");
     thunderTime    = nbttagcompound.GetInteger("thunderTime");
     isThundering   = nbttagcompound.GetBoolean("thundering");
     if (nbttagcompound.HasKey("Player"))
     {
         field_22195_h = nbttagcompound.GetCompoundTag("Player");
         dimension     = field_22195_h.GetInteger("Dimension");
     }
 }
Example #7
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);
 }
Example #8
0
 protected internal override void ReadEntityFromNBT(net.minecraft.src.NBTTagCompound
                                                    nbttagcompound)
 {
     base.ReadEntityFromNBT(nbttagcompound);
     net.minecraft.src.NBTTagList nbttaglist = nbttagcompound.GetTagList("Inventory");
     inventory.ReadFromNBT(nbttaglist);
     dimension  = nbttagcompound.GetInteger("Dimension");
     sleeping   = nbttagcompound.GetBoolean("Sleeping");
     sleepTimer = nbttagcompound.GetShort("SleepTimer");
     if (sleeping)
     {
         playerLocation = new net.minecraft.src.ChunkCoordinates(net.minecraft.src.MathHelper
                                                                 .Floor_double(posX), net.minecraft.src.MathHelper.Floor_double(posY), net.minecraft.src.MathHelper
                                                                 .Floor_double(posZ));
         WakeUpPlayer(true, true, false);
     }
     if (nbttagcompound.HasKey("SpawnX") && nbttagcompound.HasKey("SpawnY") && nbttagcompound
         .HasKey("SpawnZ"))
     {
         spawnChunk = new net.minecraft.src.ChunkCoordinates(nbttagcompound.GetInteger("SpawnX"
                                                                                       ), nbttagcompound.GetInteger("SpawnY"), nbttagcompound.GetInteger("SpawnZ"));
     }
 }
Example #9
0
        public static net.minecraft.src.Chunk LoadChunkIntoWorldFromCompound(net.minecraft.src.World
                                                                             world, net.minecraft.src.NBTTagCompound nbttagcompound)
        {
            int i = nbttagcompound.GetInteger("xPos");
            int j = nbttagcompound.GetInteger("zPos");

            net.minecraft.src.Chunk chunk = new net.minecraft.src.Chunk(world, i, j);
            chunk.blocks = nbttagcompound.GetByteArray("Blocks");
            chunk.data   = new net.minecraft.src.NibbleArray(nbttagcompound.GetByteArray("Data"
                                                                                         ));
            chunk.skylightMap = new net.minecraft.src.NibbleArray(nbttagcompound.GetByteArray
                                                                      ("SkyLight"));
            chunk.blocklightMap = new net.minecraft.src.NibbleArray(nbttagcompound.GetByteArray
                                                                        ("BlockLight"));
            chunk.heightMap          = nbttagcompound.GetByteArray("HeightMap");
            chunk.isTerrainPopulated = nbttagcompound.GetBoolean("TerrainPopulated");
            if (!chunk.data.IsValid())
            {
                chunk.data = new net.minecraft.src.NibbleArray(chunk.blocks.Length);
            }
            if (chunk.heightMap == null || !chunk.skylightMap.IsValid())
            {
                chunk.heightMap   = new byte[256];
                chunk.skylightMap = new net.minecraft.src.NibbleArray(chunk.blocks.Length);
                chunk.Func_353_b();
            }
            if (!chunk.blocklightMap.IsValid())
            {
                chunk.blocklightMap = new net.minecraft.src.NibbleArray(chunk.blocks.Length);
                chunk.Func_348_a();
            }
            net.minecraft.src.NBTTagList nbttaglist = nbttagcompound.GetTagList("Entities");
            if (nbttaglist != null)
            {
                for (int k = 0; k < nbttaglist.TagCount(); k++)
                {
                    net.minecraft.src.NBTTagCompound nbttagcompound1 = (net.minecraft.src.NBTTagCompound
                                                                        )nbttaglist.TagAt(k);
                    net.minecraft.src.Entity entity = net.minecraft.src.EntityList.CreateEntityFromNBT
                                                          (nbttagcompound1, world);
                    chunk.hasEntities = true;
                    if (entity != null)
                    {
                        chunk.AddEntity(entity);
                    }
                }
            }
            net.minecraft.src.NBTTagList nbttaglist1 = nbttagcompound.GetTagList("TileEntities"
                                                                                 );
            if (nbttaglist1 != null)
            {
                for (int l = 0; l < nbttaglist1.TagCount(); l++)
                {
                    net.minecraft.src.NBTTagCompound nbttagcompound2 = (net.minecraft.src.NBTTagCompound
                                                                        )nbttaglist1.TagAt(l);
                    net.minecraft.src.TileEntity tileentity = net.minecraft.src.TileEntity.CreateAndLoadEntity
                                                                  (nbttagcompound2);
                    if (tileentity != null)
                    {
                        chunk.AddTileEntity(tileentity);
                    }
                }
            }
            return(chunk);
        }
Example #10
0
 protected internal override void ReadEntityFromNBT(net.minecraft.src.NBTTagCompound
                                                    nbttagcompound)
 {
     base.ReadEntityFromNBT(nbttagcompound);
     SetSaddled(nbttagcompound.GetBoolean("Saddle"));
 }