コード例 #1
0
        public static AnvilConverterData Load(NBTTagCompound par0NBTTagCompound)
        {
            int i = par0NBTTagCompound.GetInteger("xPos");
            int j = par0NBTTagCompound.GetInteger("zPos");
            AnvilConverterData anvilconverterdata = new AnvilConverterData(i, j);

            anvilconverterdata.Blocks           = par0NBTTagCompound.GetByteArray("Blocks");
            anvilconverterdata.Data             = new NibbleArrayReader(par0NBTTagCompound.GetByteArray("Data"), 7);
            anvilconverterdata.SkyLight         = new NibbleArrayReader(par0NBTTagCompound.GetByteArray("SkyLight"), 7);
            anvilconverterdata.BlockLight       = new NibbleArrayReader(par0NBTTagCompound.GetByteArray("BlockLight"), 7);
            anvilconverterdata.Heightmap        = par0NBTTagCompound.GetByteArray("HeightMap");
            anvilconverterdata.TerrainPopulated = par0NBTTagCompound.Getbool("TerrainPopulated");
            anvilconverterdata.Entities         = par0NBTTagCompound.GetTagList("Entities");
            anvilconverterdata.TileEntities     = par0NBTTagCompound.GetTagList("TileEntities");
            anvilconverterdata.TileTicks        = par0NBTTagCompound.GetTagList("TileTicks");

            //try
            {
                anvilconverterdata.LastUpdated = par0NBTTagCompound.GetLong("LastUpdate");
            }            /*
                          * catch (ClassCastException classcastexception)
                          * {
                          *     anvilconverterdata.LastUpdated = par0NBTTagCompound.GetInteger("LastUpdate");
                          * }*/

            return(anvilconverterdata);
        }
コード例 #2
0
        /// <summary>
        /// Reads a tile entity from NBT.
        /// </summary>
        public override void ReadFromNBT(NBTTagCompound par1NBTTagCompound)
        {
            base.ReadFromNBT(par1NBTTagCompound);
            NBTTagList nbttaglist = par1NBTTagCompound.GetTagList("Items");

            ChestContents = 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 < ChestContents.Length)
                {
                    ChestContents[j] = ItemStack.LoadItemStackFromNBT(nbttagcompound);
                }
            }
        }
コード例 #3
0
        /// <summary>
        /// Reads a tile entity from NBT.
        /// </summary>
        public override void ReadFromNBT(NBTTagCompound par1NBTTagCompound)
        {
            base.ReadFromNBT(par1NBTTagCompound);
            NBTTagList nbttaglist = par1NBTTagCompound.GetTagList("Items");

            FurnaceItemStacks = new ItemStack[GetSizeInventory()];

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

                if (byte0 >= 0 && byte0 < FurnaceItemStacks.Length)
                {
                    FurnaceItemStacks[byte0] = ItemStack.LoadItemStackFromNBT(nbttagcompound);
                }
            }

            FurnaceBurnTime     = par1NBTTagCompound.GetShort("BurnTime");
            FurnaceCookTime     = par1NBTTagCompound.GetShort("CookTime");
            CurrentItemBurnTime = GetItemBurnTime(FurnaceItemStacks[1]);
        }