Package net.minecraft.nbt

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


    //if (ChargingBench.isDebugging) System.out.println("ReadNBT.CurrentEergy: " + currentEnergy);

    // Our inventory
    contents = new ItemStack[Info.CB_INVENTORY_SIZE];
    NBTTagList nbttaglist = nbttagcompound.getTagList("Items");
    for (int i = 0; i < nbttaglist.tagCount(); ++i)
    {
      NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbttaglist.tagAt(i);
      int j = nbttagcompound1.getByte("Slot") & 255;

      if (j >= 0 && j < contents.length)
View Full Code Here


    currentEnergy = nbttagcompound.getInteger("currentEnergy");

    // Our inventory
    contents = new ItemStack[Info.BS_INVENTORY_SIZE];
    NBTTagList nbttaglist = nbttagcompound.getTagList("Items");
    for (int i = 0; i < nbttaglist.tagCount(); ++i)
    {
      NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbttaglist.tagAt(i);
      int j = nbttagcompound1.getByte("Slot") & 255;

      if (j >= 0 && j < contents.length)
View Full Code Here

        }
       
        NBTTagList outputPins = ((NBTTagCompound)circuits.tagAt(c)).getTagList("outputPins");
        if(outputPins != null)
        {
          for(int i = 0; i < outputPins.tagCount() && i < _pinMappingOutputs[c].length; i++)
          {
            int pin = ((NBTTagCompound)outputPins.tagAt(i)).getInteger("pin");
            int buffer = ((NBTTagCompound)outputPins.tagAt(i)).getInteger("buffer");
            _pinMappingOutputs[c][i] = new PinMapping(pin, buffer);
          }
View Full Code Here

  public void readCircuitsOnly(NBTTagCompound nbttagcompound)
  {
    NBTTagList circuits = nbttagcompound.getTagList("circuits");
    if(circuits != null)
    {
      for(int c = 0; c < circuits.tagCount(); c++)
      {
        initCircuit(c, ((NBTTagCompound)circuits.tagAt(c)).getString("circuit"));
       
        NBTTagList inputPins = ((NBTTagCompound)circuits.tagAt(c)).getTagList("inputPins");
        if(inputPins != null)
View Full Code Here

        initCircuit(c, ((NBTTagCompound)circuits.tagAt(c)).getString("circuit"));
       
        NBTTagList inputPins = ((NBTTagCompound)circuits.tagAt(c)).getTagList("inputPins");
        if(inputPins != null)
        {
          for(int i = 0; i < inputPins.tagCount() && i < _pinMappingInputs[c].length; i++)
          {
            int pin = ((NBTTagCompound)inputPins.tagAt(i)).getInteger("pin");
            int buffer = ((NBTTagCompound)inputPins.tagAt(i)).getInteger("buffer");
            _pinMappingInputs[c][i] = new PinMapping(pin, buffer);
          }
View Full Code Here

    readNBT(tags);
  }

  public void readNBT(NBTTagCompound tags) {
    NBTTagList tagList = tags.getTagList("Baubles.Inventory", 10);
    for (int i = 0; i < tagList.tagCount(); ++i) {
      NBTTagCompound nbttagcompound = (NBTTagCompound) tagList
          .getCompoundTagAt(i);
      int j = nbttagcompound.getByte("Slot") & 255;
      ItemStack itemstack = ItemStack
          .loadItemStackFromNBT(nbttagcompound);
View Full Code Here

  public void readFromNBT(NBTTagCompound nbttagcompound)
  {
    super.readFromNBT(nbttagcompound);
   
    NBTTagList nbttaglist = nbttagcompound.getTagList("Tanks");
    for(int i = 0; i < nbttaglist.tagCount(); i++)
    {
      NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbttaglist.tagAt(i);
      int j = nbttagcompound1.getByte("Tank") & 0xff;
      if(j >= 0 && j < _tanks.length)
      {
View Full Code Here

  }
 
  private static void updateEnchantment(ItemStack stack, int enchantId, short newLevel)
  {
    NBTTagList tagList = stack.getTagCompound().getTagList("ench");
    for(int i = 0; i < tagList.tagCount(); ++i)
    {
      if(((NBTTagCompound)tagList.tagAt(i)).getShort("id") == enchantId)
      {
        ((NBTTagCompound)tagList.tagAt(i)).setShort("lvl", newLevel);
      }
View Full Code Here

  public void readFromNBT(NBTTagCompound nbttagcompound)
  {
    super.readFromNBT(nbttagcompound);
    NBTTagList nbttaglist = nbttagcompound.getTagList("Items");
    _inventory = new ItemStack[getSizeInventory()];
    for(int i = 0; i < nbttaglist.tagCount(); i++)
    {
      NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbttaglist.tagAt(i);
      int j = nbttagcompound1.getByte("Slot") & 0xff;
      if(j >= 0 && j < _inventory.length)
      {
View Full Code Here

    if (outputRate < Info.AE_MIN_OUTPUT) outputRate = Info.AE_MIN_OUTPUT;
    if (energyBuffer > packetSize * Info.AE_PACKETS_TICK) energyBuffer = packetSize * Info.AE_PACKETS_TICK;
    energyCap = Math.max(packetSize, outputRate);

    NBTTagList nbttaglist = nbttagcompound.getTagList("SideSettings");
    for (int i = 0; i < nbttaglist.tagCount(); ++i)
    {
      NBTTagCompound entry = (NBTTagCompound)nbttaglist.tagAt(i);
      if (i >= 0 && i < sideSettings.length)
      {
        sideSettings[i] = (byte)(entry.getByte("Flags") & 255);
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.