Package net.minecraft.server

Examples of net.minecraft.server.ItemStack


   *
   * @param item ItemStack
   * @param compound TagCompound
   */
  public static void saveItemStack(org.bukkit.inventory.ItemStack item, CommonTagCompound compound) {
    ItemStack stack = (ItemStack) HandleConverter.toItemStackHandle.convert(item);
    stack.save((NBTTagCompound) compound.getHandle());
  }
View Full Code Here


    this.maxstacksize = size;
  }

  @Override
  public ItemStack splitStack(int index, int size) {
    ItemStack item = this.getItem(index);
    if (item != null) {
      ItemStack itemstack;
      if (item.count <= size) {
        itemstack = item;
        this.setItem(index, null);
        return itemstack;
      } else {
View Full Code Here

    }
  }

  @Override
  public ItemStack splitWithoutUpdate(int index) {
    ItemStack item = this.getItem(index);
    if (item != null) {
      this.setItem(index, null);
      return item;
    } else {
      return null;
View Full Code Here

TOP

Related Classes of net.minecraft.server.ItemStack

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.