Package org.bukkit.inventory

Examples of org.bukkit.inventory.PlayerInventory.firstEmpty()


                  removed++;
                }
                i++;
              }
             
              int firstEmpty = playerInv.firstEmpty();
              if (firstEmpty > 0) {
                playerInv.setItem(firstEmpty, team.getKind().getBlockHead());
              }
             
              if (removed > 1) {
View Full Code Here


      }

      if (leftover != 0) {
    inventory.remove(i);

    if (inventory.firstEmpty() == -1) {
        player.getWorld().dropItem(player.getLocation(), new ItemStack(item, leftover));
    } else {
        inventory.setItem(inventory.firstEmpty(), new ItemStack(item, leftover));
    }
View Full Code Here

    inventory.remove(i);

    if (inventory.firstEmpty() == -1) {
        player.getWorld().dropItem(player.getLocation(), new ItemStack(item, leftover));
    } else {
        inventory.setItem(inventory.firstEmpty(), new ItemStack(item, leftover));
    }

    counter = 0;
    break;
      } else {
View Full Code Here

    updateReady = false;
  }
 
  public static boolean addHead(Player player, String skullOwner) {
    PlayerInventory inv = player.getInventory();
    int firstEmpty = inv.firstEmpty();
    if (firstEmpty == -1) {
      return false;
    } else {
      inv.setItem(firstEmpty, new Skull(skullOwner).getItemStack());
      return true;
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.