Package net.minecraft.nbt

Examples of net.minecraft.nbt.NBTTagList.appendTag()


      NBTTagList nbttaglist = new NBTTagList();
      for (ItemStack item : failedDrops)
      {
        NBTTagCompound nbttagcompound1 = new NBTTagCompound();
        item.writeToNBT(nbttagcompound1);
        nbttaglist.appendTag(nbttagcompound1);
      }
      tag.setTag("DropItems", nbttaglist);
    }
  }
 
View Full Code Here


      for(int i = 0; i < inventoryContents.length; i++) {
        if(inventoryContents[i] != null) {
          NBTTagCompound stacktag = new NBTTagCompound();
          stacktag.setByte("Slot", (byte)i);
          inventoryContents[i].writeToNBT(stacktag);
          nbttaglist.appendTag(stacktag);
        }
      }
      tag.setTag("Items", nbttaglist);
    }
View Full Code Here

    for(int i = 0; i < _inventories.length; i++) {
      if((_inventories[i]) != null) {
        NBTTagCompound itemTag = new NBTTagCompound();
        itemTag.setByte("Slot", (byte)i);
        _inventories[i].writeToNBT(itemTag);
        tagList.appendTag(itemTag);
      }
    }
   
    if(tagList.tagCount() > 0) {
      tag.setTag("Items", tagList);
View Full Code Here

  // Helpers
  protected void encodeSettings(NBTTagCompound destination) {
    NBTTagList tagArray = new NBTTagList();
   
    for(int i = 0; i < numChannels; i++) {
      tagArray.appendTag(encodeSetting(i));
    }
   
    destination.setTag("redNetConfig", tagArray);
  }
 
View Full Code Here

    for(int i = 0; i < getNumTanks(); i++) {
      if(tanks[i] != null && tanks[i].getFluid() != null) {
        NBTTagCompound fluidTag = new NBTTagCompound();
        fluidTag.setInteger("tagIdx", i);
        tanks[i].getFluid().writeToNBT(fluidTag);
        fluidTagList.appendTag(fluidTag);
      }
    }
   
    if(fluidTagList.tagCount() > 0) {
      tag.setTag("fluids", fluidTagList);
View Full Code Here

    for(int i = 0; i < _inventories.length; i++) {
      if((_inventories[i]) != null) {
        NBTTagCompound itemTag = new NBTTagCompound();
        itemTag.setByte("Slot", (byte)i);
        _inventories[i].writeToNBT(itemTag);
        tagList.appendTag(itemTag);
      }
    }
   
    if(tagList.tagCount() > 0) {
      tag.setTag("Items", tagList);
View Full Code Here

    NBTTagList tileEntitiesList = new NBTTagList();
    for (TileEntity tileEntity : this.tileEntities) {
      NBTTagCompound tileEntityTagCompound = new NBTTagCompound();
      tileEntity.writeToNBT(tileEntityTagCompound);
      tileEntitiesList.appendTag(tileEntityTagCompound);
    }

    tagCompound.setTag("TileEntities", tileEntitiesList);
  }
View Full Code Here

        {
            if (this.occupants.get(var3) != null)
            {
                NBTTagCompound var4 = new NBTTagCompound();
                this.occupants.get(var3).writeEntityToNBT(var4);
                occupantsTagList.appendTag(var4);
            }
        }

        par1NBTTagCompound.setTag("occupants", occupantsTagList);
       
View Full Code Here

            if (this.chestContents[var3] != null)
            {
                NBTTagCompound var4 = new NBTTagCompound();
                var4.setByte("Slot", (byte)var3);
                this.chestContents[var3].writeToNBT(var4);
                var2.appendTag(var4);
            }
        }

        par1NBTTagCompound.setTag("Items", var2);
       
View Full Code Here

            if (this.furnaceItemStacks[var3] != null)
            {
                NBTTagCompound var4 = new NBTTagCompound();
                var4.setByte("Slot", (byte)var3);
                this.furnaceItemStacks[var3].writeToNBT(var4);
                var2.appendTag(var4);
            }
        }

        par1NBTTagCompound.setTag("Items", var2);
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.