Exemplo n.º 1
0
        public override void readFromNBT(NBTTagCompound nbttagcompound)
        {
            base.readFromNBT(nbttagcompound);
            NBTTagList nbttaglist = nbttagcompound.getTagList("Items");

            chestContents = new ItemStack[getSizeInventory()];
            for (int i = 0; i < nbttaglist.tagCount(); i++)
            {
                var nbttagcompound1 = (NBTTagCompound)nbttaglist.tagAt(i);
                int j = nbttagcompound1.getByte("Slot") & 0xff;
                if (j >= 0 && j < chestContents.Length)
                {
                    chestContents[j] = new ItemStack(nbttagcompound1);
                }
            }
        }
Exemplo n.º 2
0
        public override void readFromNBT(NBTTagCompound nbttagcompound)
        {
            base.readFromNBT(nbttagcompound);
            NBTTagList nbttaglist = nbttagcompound.getTagList("Items");

            furnaceItemStacks = new ItemStack[getSizeInventory()];
            for (int i = 0; i < nbttaglist.tagCount(); i++)
            {
                var  nbttagcompound1 = (NBTTagCompound)nbttaglist.tagAt(i);
                byte byte0           = nbttagcompound1.getByte("Slot");
                if (byte0 >= 0 && byte0 < furnaceItemStacks.Length)
                {
                    furnaceItemStacks[byte0] = new ItemStack(nbttagcompound1);
                }
            }

            furnaceBurnTime     = nbttagcompound.getShort("BurnTime");
            furnaceCookTime     = nbttagcompound.getShort("CookTime");
            currentItemBurnTime = getItemBurnTime(furnaceItemStacks[1]);
        }
Exemplo n.º 3
0
 public void readFromNBT(NBTTagList nbttaglist)
 {
     mainInventory  = new ItemStack[36];
     armorInventory = new ItemStack[4];
     for (int i = 0; i < nbttaglist.tagCount(); i++)
     {
         var nbttagcompound = (NBTTagCompound)nbttaglist.tagAt(i);
         int j         = nbttagcompound.getByte("Slot") & 0xff;
         var itemstack = new ItemStack(nbttagcompound);
         if (itemstack.getItem() == null)
         {
             continue;
         }
         if (j >= 0 && j < mainInventory.Length)
         {
             mainInventory[j] = itemstack;
         }
         if (j >= 100 && j < armorInventory.Length + 100)
         {
             armorInventory[j - 100] = itemstack;
         }
     }
 }