Example #1
0
        protected internal override void ReadEntityFromNBT(net.minecraft.src.NBTTagCompound
                                                           nbttagcompound)
        {
            direction = nbttagcompound.GetByte("Dir");
            xPosition = nbttagcompound.GetInteger("TileX");
            yPosition = nbttagcompound.GetInteger("TileY");
            zPosition = nbttagcompound.GetInteger("TileZ");
            string s = nbttagcompound.GetString("Motive");

            net.minecraft.src.EnumArt[] aenumart = net.minecraft.src.EnumArt.Values();
            int i = aenumart.Length;

            for (int j = 0; j < i; j++)
            {
                net.minecraft.src.EnumArt enumart = aenumart[j];
                if (enumart.title.Equals(s))
                {
                    art = enumart;
                }
            }
            if (art == null)
            {
                art = net.minecraft.src.EnumArt.Kebab;
            }
            Func_179_a(direction);
        }
Example #2
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 #3
0
 protected internal override void ReadEntityFromNBT(net.minecraft.src.NBTTagCompound
                                                    nbttagcompound)
 {
     minecartType = nbttagcompound.GetInteger("Type");
     if (minecartType == 2)
     {
         pushX = nbttagcompound.GetDouble("PushX");
         pushZ = nbttagcompound.GetDouble("PushZ");
         fuel  = nbttagcompound.GetShort("Fuel");
     }
     else
     {
         if (minecartType == 1)
         {
             net.minecraft.src.NBTTagList nbttaglist = nbttagcompound.GetTagList("Items");
             cargoItems = new net.minecraft.src.ItemStack[GetSizeInventory()];
             for (int i = 0; i < nbttaglist.TagCount(); i++)
             {
                 net.minecraft.src.NBTTagCompound nbttagcompound1 = (net.minecraft.src.NBTTagCompound
                                                                     )nbttaglist.TagAt(i);
                 int j = nbttagcompound1.GetByte("Slot");
                 if (j >= 0 && j < cargoItems.Length)
                 {
                     cargoItems[j] = new net.minecraft.src.ItemStack(nbttagcompound1);
                 }
             }
         }
     }
 }
Example #4
0
        public override void Func_28148_a(net.minecraft.src.NBTTagCompound nbttagcompound
                                          )
        {
            field_28162_d = nbttagcompound.GetByte("dimension");
            field_28164_b = nbttagcompound.GetInteger("xCenter");
            field_28163_c = nbttagcompound.GetInteger("zCenter");
            field_28161_e = nbttagcompound.GetByte("scale");
            if (((sbyte)field_28161_e) < 0)
            {
                field_28161_e = 0;
            }
            if (field_28161_e > 4)
            {
                field_28161_e = 4;
            }
            short word0 = nbttagcompound.GetShort("width");
            short word1 = nbttagcompound.GetShort("height");

            if (word0 == 128 && word1 == 128)
            {
                field_28160_f = nbttagcompound.GetByteArray("colors");
            }
            else
            {
                byte[] abyte0 = nbttagcompound.GetByteArray("colors");
                field_28160_f = new byte[16384];
                int i = (128 - word0) / 2;
                int j = (128 - word1) / 2;
                for (int k = 0; k < word1; k++)
                {
                    int l = k + j;
                    if (l < 0 && l >= 128)
                    {
                        continue;
                    }
                    for (int i1 = 0; i1 < word0; i1++)
                    {
                        int j1 = i1 + i;
                        if (j1 >= 0 || j1 < 128)
                        {
                            field_28160_f[j1 + l * 128] = abyte0[i1 + k * word0];
                        }
                    }
                }
            }
        }
Example #5
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 #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)
 {
     xCoord = nbttagcompound.GetInteger("x");
     yCoord = nbttagcompound.GetInteger("y");
     zCoord = nbttagcompound.GetInteger("z");
 }
Example #8
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 #9
0
 protected internal override void ReadEntityFromNBT(net.minecraft.src.NBTTagCompound
                                                    nbttagcompound)
 {
     base.ReadEntityFromNBT(nbttagcompound);
     SetSlimeSize(nbttagcompound.GetInteger("Size") + 1);
 }
Example #10
0
 // Referenced classes of package net.minecraft.src:
 //            TileEntity, NBTTagCompound
 public override void ReadFromNBT(net.minecraft.src.NBTTagCompound nbttagcompound)
 {
     base.ReadFromNBT(nbttagcompound);
     field_28009_a = nbttagcompound.GetInteger("Record");
 }