Package org.bukkit.craftbukkit.v1_7_R1.inventory

Examples of org.bukkit.craftbukkit.v1_7_R1.inventory.CraftItemStack


   * @return      Deserialized inventory
   */
  public static Inventory fromString(String data) {
    ByteArrayInputStream inputStream = new ByteArrayInputStream(Base64Coder.decodeLines(data));
    NBTTagList itemList = (NBTTagList) readNbt(new DataInputStream(inputStream), 0);
    Inventory inventory = new CraftInventoryCustom(null, itemList.size());

    for (int i = 0; i < itemList.size(); i++) {
      NBTTagCompound inputObject = itemList.get(i);

      if (!inputObject.isEmpty()) {
        inventory.setItem(i, CraftItemStack.asCraftMirror(
            net.minecraft.server.v1_7_R1.ItemStack.createStack(inputObject)));
      }
    }

    // Serialize that array
View Full Code Here


  }

  public void onAdd(RemoteEntity inEntity)
  {
    super.onAdd(inEntity);
    this.m_inventory = new CraftInventoryCustom((InventoryHolder)this.m_entity.getHandle(), this.m_size);
  }
View Full Code Here

    NBTTagList itemList = new NBTTagList();

    // Save every element in the list
    for (int i = 0; i < inventory.getSize(); i++) {
      NBTTagCompound outputObject = new NBTTagCompound();
      CraftItemStack craft = getCraftVersion(inventory.getItem(i));

      // Convert the item stack to a NBT compound
      if (craft != null)
        CraftItemStack.asNMSCopy(craft).save(outputObject);
      itemList.add(outputObject);
View Full Code Here

TOP

Related Classes of org.bukkit.craftbukkit.v1_7_R1.inventory.CraftItemStack

Copyright © 2018 www.massapicom. 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.