/// <summary>
        /// (abstract) Protected helper method to read subclass entity data from NBT.
        /// </summary>
        public override void ReadEntityFromNBT(NBTTagCompound par1NBTTagCompound)
        {
            Direction = par1NBTTagCompound.GetByte("Dir");
            XPosition = par1NBTTagCompound.GetInteger("TileX");
            YPosition = par1NBTTagCompound.GetInteger("TileY");
            ZPosition = par1NBTTagCompound.GetInteger("TileZ");
            string s = par1NBTTagCompound.GetString("Motive");

            Art[] aenumart = Art.ArtArray;
            int   i        = aenumart.Length;

            for (int j = 0; j < i; j++)
            {
                Art enumart = aenumart[j];

                if (enumart.Title.Equals(s))
                {
                    Art = enumart;
                }
            }

            if (Art == null)
            {
                Art = Art.Kebab;
            }

            Func_412_b(Direction);
        }
 /// <summary>
 /// Reads a tile entity from NBT.
 /// </summary>
 public override void ReadFromNBT(NBTTagCompound par1NBTTagCompound)
 {
     base.ReadFromNBT(par1NBTTagCompound);
     StoredBlockID     = par1NBTTagCompound.GetInteger("blockId");
     StoredMetadata    = par1NBTTagCompound.GetInteger("blockData");
     StoredOrientation = par1NBTTagCompound.GetInteger("facing");
     LastProgress      = Progress = par1NBTTagCompound.GetFloat("progress");
     Extending         = par1NBTTagCompound.Getbool("extending");
 }
Пример #3
0
 /// <summary>
 /// Reads food stats from an NBT object.
 /// </summary>
 public virtual void ReadNBT(NBTTagCompound par1NBTTagCompound)
 {
     if (par1NBTTagCompound.HasKey("foodLevel"))
     {
         FoodLevel           = par1NBTTagCompound.GetInteger("foodLevel");
         FoodTimer           = par1NBTTagCompound.GetInteger("foodTickTimer");
         FoodSaturationLevel = par1NBTTagCompound.GetFloat("foodSaturationLevel");
         FoodExhaustionLevel = par1NBTTagCompound.GetFloat("foodExhaustionLevel");
     }
 }
Пример #4
0
        /// <summary>
        /// reads in data from the NBTTagCompound into this MapDataBase
        /// </summary>
        public override void ReadFromNBT(NBTTagCompound par1NBTTagCompound)
        {
            Dimension = par1NBTTagCompound.GetByte("dimension");
            XCenter   = par1NBTTagCompound.GetInteger("xCenter");
            ZCenter   = par1NBTTagCompound.GetInteger("zCenter");
            Scale     = par1NBTTagCompound.GetByte("scale");

            if (Scale < 0)
            {
                Scale = 0;
            }

            if (Scale > 4)
            {
                Scale = 4;
            }

            short word0 = par1NBTTagCompound.GetShort("width");
            short word1 = par1NBTTagCompound.GetShort("height");

            if (word0 == 128 && word1 == 128)
            {
                Colors = par1NBTTagCompound.GetByteArray("colors");
            }
            else
            {
                byte[] abyte0 = par1NBTTagCompound.GetByteArray("colors");
                Colors = 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)
                        {
                            Colors[j1 + l * 128] = abyte0[i1 + k * word0];
                        }
                    }
                }
            }
        }
Пример #5
0
        public WorldInfo(NBTTagCompound par1NBTTagCompound)
        {
            TerrainType = WorldType.DEFAULT;
            Hardcore    = false;
            RandomSeed  = par1NBTTagCompound.GetLong("RandomSeed");

            if (par1NBTTagCompound.HasKey("generatorName"))
            {
                string s = par1NBTTagCompound.GetString("generatorName");
                TerrainType = WorldType.ParseWorldType(s);

                if (TerrainType == null)
                {
                    TerrainType = WorldType.DEFAULT;
                }
                else if (TerrainType.Func_48626_e())
                {
                    int i = 0;

                    if (par1NBTTagCompound.HasKey("generatorVersion"))
                    {
                        i = par1NBTTagCompound.GetInteger("generatorVersion");
                    }

                    TerrainType = TerrainType.Func_48629_a(i);
                }
            }

            GameType = par1NBTTagCompound.GetInteger("GameType");

            if (par1NBTTagCompound.HasKey("MapFeatures"))
            {
                MapFeaturesEnabled = par1NBTTagCompound.Getbool("MapFeatures");
            }
            else
            {
                MapFeaturesEnabled = true;
            }

            SpawnX         = par1NBTTagCompound.GetInteger("SpawnX");
            SpawnY         = par1NBTTagCompound.GetInteger("SpawnY");
            SpawnZ         = par1NBTTagCompound.GetInteger("SpawnZ");
            WorldTime      = par1NBTTagCompound.GetLong("Time");
            LastTimePlayed = par1NBTTagCompound.GetLong("LastPlayed");
            SizeOnDisk     = par1NBTTagCompound.GetLong("SizeOnDisk");
            LevelName      = par1NBTTagCompound.GetString("LevelName");
            SaveVersion    = par1NBTTagCompound.GetInteger("version");
            RainTime       = par1NBTTagCompound.GetInteger("rainTime");
            Raining        = par1NBTTagCompound.Getbool("raining");
            ThunderTime    = par1NBTTagCompound.GetInteger("thunderTime");
            Thundering     = par1NBTTagCompound.Getbool("thundering");
            Hardcore       = par1NBTTagCompound.Getbool("hardcore");

            if (par1NBTTagCompound.HasKey("Player"))
            {
                PlayerTag = par1NBTTagCompound.GetCompoundTag("Player");
                Dimension = PlayerTag.GetInteger("Dimension");
            }
        }
Пример #6
0
        /// <summary>
        /// (abstract) Protected helper method to read subclass entity data from NBT.
        /// </summary>
        public override void ReadEntityFromNBT(NBTTagCompound par1NBTTagCompound)
        {
            MinecartType = par1NBTTagCompound.GetInteger("Type");

            if (MinecartType == 2)
            {
                PushX = (float)par1NBTTagCompound.GetDouble("PushX");
                PushZ = (float)par1NBTTagCompound.GetDouble("PushZ");
                Fuel  = par1NBTTagCompound.GetShort("Fuel");
            }
            else if (MinecartType == 1)
            {
                NBTTagList nbttaglist = par1NBTTagCompound.GetTagList("Items");
                CargoItems = new ItemStack[GetSizeInventory()];

                for (int i = 0; i < nbttaglist.TagCount(); i++)
                {
                    NBTTagCompound nbttagcompound = (NBTTagCompound)nbttaglist.TagAt(i);
                    int            j = nbttagcompound.GetByte("Slot") & 0xff;

                    if (j >= 0 && j < CargoItems.Length)
                    {
                        CargoItems[j] = ItemStack.LoadItemStackFromNBT(nbttagcompound);
                    }
                }
            }
        }
Пример #7
0
 /// <summary>
 /// (abstract) Protected helper method to read subclass entity data from NBT.
 /// </summary>
 public override void ReadEntityFromNBT(NBTTagCompound par1NBTTagCompound)
 {
     base.ReadEntityFromNBT(par1NBTTagCompound);
     SetGrowingAge(par1NBTTagCompound.GetInteger("Age"));
 }
 /// <summary>
 /// (abstract) Protected helper method to read subclass entity data from NBT.
 /// </summary>
 public override void ReadEntityFromNBT(NBTTagCompound par1NBTTagCompound)
 {
     base.ReadEntityFromNBT(par1NBTTagCompound);
     SetProfession(par1NBTTagCompound.GetInteger("Profession"));
 }
 /// <summary>
 /// (abstract) Protected helper method to read subclass entity data from NBT.
 /// </summary>
 public override void ReadEntityFromNBT(NBTTagCompound par1NBTTagCompound)
 {
     base.ReadEntityFromNBT(par1NBTTagCompound);
     Score = par1NBTTagCompound.GetInteger("Score");
 }
Пример #10
0
        private Chunk Func_48444_a(World par1World, NBTTagCompound par2NBTTagCompound)
        {
            int   i     = par2NBTTagCompound.GetInteger("xPos");
            int   j     = par2NBTTagCompound.GetInteger("zPos");
            Chunk chunk = new Chunk(par1World, i, j);

            chunk.HeightMap          = par2NBTTagCompound.Func_48182_l("HeightMap");
            chunk.IsTerrainPopulated = par2NBTTagCompound.Getbool("TerrainPopulated");
            NBTTagList nbttaglist = par2NBTTagCompound.GetTagList("Sections");
            sbyte      byte0      = 16;

            ExtendedBlockStorage[] aextendedblockstorage = new ExtendedBlockStorage[byte0];

            for (int k = 0; k < nbttaglist.TagCount(); k++)
            {
                NBTTagCompound       nbttagcompound       = (NBTTagCompound)nbttaglist.TagAt(k);
                byte                 byte1                = nbttagcompound.GetByte("Y");
                ExtendedBlockStorage extendedblockstorage = new ExtendedBlockStorage(byte1 << 4);
                extendedblockstorage.SetBlockLSBArray(nbttagcompound.GetByteArray("Blocks"));

                if (nbttagcompound.HasKey("Add"))
                {
                    extendedblockstorage.SetBlockMSBArray(new NibbleArray(nbttagcompound.GetByteArray("Add"), 4));
                }

                extendedblockstorage.SetBlockMetadataArray(new NibbleArray(nbttagcompound.GetByteArray("Data"), 4));
                extendedblockstorage.SetSkylightArray(new NibbleArray(nbttagcompound.GetByteArray("SkyLight"), 4));
                extendedblockstorage.SetBlocklightArray(new NibbleArray(nbttagcompound.GetByteArray("BlockLight"), 4));
                extendedblockstorage.Func_48708_d();
                aextendedblockstorage[byte1] = extendedblockstorage;
            }

            chunk.SetStorageArrays(aextendedblockstorage);

            if (par2NBTTagCompound.HasKey("Biomes"))
            {
                chunk.SetBiomeArray(par2NBTTagCompound.GetByteArray("Biomes"));
            }

            NBTTagList nbttaglist1 = par2NBTTagCompound.GetTagList("Entities");

            if (nbttaglist1 != null)
            {
                for (int l = 0; l < nbttaglist1.TagCount(); l++)
                {
                    NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbttaglist1.TagAt(l);
                    Entity         entity          = EntityList.CreateEntityFromNBT(nbttagcompound1, par1World);
                    chunk.HasEntities = true;

                    if (entity != null)
                    {
                        chunk.AddEntity(entity);
                    }
                }
            }

            NBTTagList nbttaglist2 = par2NBTTagCompound.GetTagList("TileEntities");

            if (nbttaglist2 != null)
            {
                for (int i1 = 0; i1 < nbttaglist2.TagCount(); i1++)
                {
                    NBTTagCompound nbttagcompound2 = (NBTTagCompound)nbttaglist2.TagAt(i1);
                    TileEntity     tileentity      = TileEntity.CreateAndLoadEntity(nbttagcompound2);

                    if (tileentity != null)
                    {
                        chunk.AddTileEntity(tileentity);
                    }
                }
            }

            if (par2NBTTagCompound.HasKey("TileTicks"))
            {
                NBTTagList nbttaglist3 = par2NBTTagCompound.GetTagList("TileTicks");

                if (nbttaglist3 != null)
                {
                    for (int j1 = 0; j1 < nbttaglist3.TagCount(); j1++)
                    {
                        NBTTagCompound nbttagcompound3 = (NBTTagCompound)nbttaglist3.TagAt(j1);
                        par1World.ScheduleBlockUpdateFromLoad(nbttagcompound3.GetInteger("x"), nbttagcompound3.GetInteger("y"), nbttagcompound3.GetInteger("z"), nbttagcompound3.GetInteger("i"), nbttagcompound3.GetInteger("t"));
                    }
                }
            }

            return(chunk);
        }
Пример #11
0
 /// <summary>
 /// (abstract) Protected helper method to read subclass entity data from NBT.
 /// </summary>
 public override void ReadEntityFromNBT(NBTTagCompound par1NBTTagCompound)
 {
     base.ReadEntityFromNBT(par1NBTTagCompound);
     SetSlimeSize(par1NBTTagCompound.GetInteger("Size") + 1);
 }
Пример #12
0
 /// <summary>
 /// (abstract) Protected helper method to read subclass entity data from NBT.
 /// </summary>
 public override void ReadEntityFromNBT(NBTTagCompound par1NBTTagCompound)
 {
     base.ReadEntityFromNBT(par1NBTTagCompound);
     Func_48147_c(par1NBTTagCompound.GetInteger("CatType"));
 }
Пример #13
0
 /// <summary>
 /// Reads a tile entity from NBT.
 /// </summary>
 public virtual void ReadFromNBT(NBTTagCompound par1NBTTagCompound)
 {
     XCoord = par1NBTTagCompound.GetInteger("x");
     YCoord = par1NBTTagCompound.GetInteger("y");
     ZCoord = par1NBTTagCompound.GetInteger("z");
 }