Package net.minecraft.item

Examples of net.minecraft.item.ItemStack.writeToNBT()


        nbt.setInteger("SpaceshipTier", this.spaceshipTier);
        nbt.setInteger("FuelLevel", this.fuelLevel);
        if (this.rocketItem != null)
        {
          ItemStack returnRocket = new ItemStack(this.rocketItem, 1, this.rocketType);
          nbt.setTag("ReturnRocket", returnRocket.writeToNBT(new NBTTagCompound()));
        }
       
        final NBTTagList var2 = new NBTTagList();

        for (int var3 = 0; var3 < this.rocketStacks.length; ++var3)
View Full Code Here


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

        return var1;
View Full Code Here

    compound = super.getDescriptionPacketData(compound)
    if (canHaveMaterial())
      compound.setString(ContainerMaterial.TAG_NAME, getMaterial().name);
    if (canHaveLock()) {
      ItemStack lock = getLockInternal();
      if (lock != null) compound.setTag("lock", lock.writeToNBT(new NBTTagCompound()));
    }
    return compound;
  }
 
  @Override
View Full Code Here

    if (canHaveMaterial())
      compound.setString(ContainerMaterial.TAG_NAME, getMaterial().name);
    if (canHaveLock()) {
      ItemStack lock = getLockInternal();
      if (lock != null)
        compound.setTag("lock", lock.writeToNBT(new NBTTagCompound()));
    }
  }
 
}
View Full Code Here

      NBTTagCompound regionCompound = new NBTTagCompound();
     
      ItemStack item;
      for (ArmorStandEquipHandler handler : BetterStorageArmorStand.getEquipHandlers(region))
        if ((item = getItem(handler)) != null)
          regionCompound.setTag(handler.id, item.writeToNBT(new NBTTagCompound()));
     
      items.setTag(region.toString(), regionCompound);
    }
    compound.setTag("Items", items);
  }
View Full Code Here

     
      backpackCompound.setInteger("count", backpackData.contents.length);
      backpackCompound.setTag("Items", NbtUtils.writeItems(backpackData.contents));
     
      if (!ItemBackpack.hasChestplateBackpackEquipped(entity))
        backpackCompound.setTag("Stack", backpack.writeToNBT(new NBTTagCompound()));
     
      persistent.setTag("Backpack", backpackCompound);
     
    } else {
     
View Full Code Here

    {
      ItemStack pattern = myPlan.getPattern();
      if ( pattern != null )
      {
        NBTTagCompound compound = new NBTTagCompound();
        pattern.writeToNBT( compound );
        data.setTag( "myPlan", compound );
        data.setInteger( "pushDirection", pushDirection.ordinal() );
      }
    }
View Full Code Here

      // "update" client side.
      inv.client.setInventorySlotContents( x + offset, is == null ? null : is.copy() );

      if ( is != null )
        is.writeToNBT( itemNBT );

      tag.setTag( Integer.toString( x + offset ), itemNBT );
    }

    data.setTag( name, tag );
View Full Code Here

       
        NBTTagCompound itemFrom = new NBTTagCompound();
        NBTTagCompound itemTo = new NBTTagCompound();

        beginStack.writeToNBT( itemFrom );
        endStack.writeToNBT(itemTo);

        toRegister.setTag("itemFrom", itemFrom);
        toRegister.setTag("itemTo", itemTo);
        toRegister.setFloat("pressureRatio", 1.0F);
       
View Full Code Here

    for (int x = 0; x < inv.getSizeInventory(); x++)
    {
      NBTTagCompound item = new NBTTagCompound();
      ItemStack is = getStackInSlot( x );
      if ( is != null )
        is.writeToNBT( item );
      opt.setTag( "item" + x, item );
    }
    data.setTag( "inv", opt );
  }
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.