Package org.bukkit.inventory

Examples of org.bukkit.inventory.ItemStack.clone()


      } else if (slot == 103) {
        playerInv.setHelmet(loadout.get(slot).clone());
      } else {
        ItemStack item = loadout.get(slot);
        if (item != null) {
          playerInv.addItem(item.clone());
        }
      }
    }
    if (this.getWarzoneConfig().getBoolean(WarzoneConfig.BLOCKHEADS)) {
      playerInv.setHelmet(team.getKind().getHat());
View Full Code Here


        if (item == null || item.getType() == Material.AIR) {
            item = new ItemStack(Material.STAINED_GLASS_PANE);
            item.getData().setData((byte) 8);
        }
        else
            item = item.clone();
        ItemMeta meta = item.getItemMeta();
        meta.setDisplayName(message);
        item.setItemMeta(meta);
        PacketPlayOutSetSlot slotPacket = getSlotPacket(player.getUniqueId(),
                player.getInventory().getHeldItemSlot() + 36, item);
View Full Code Here

                                        items.add(new Tuple2<ItemInfo, Integer>(inf.a, 0));
                                    } else {
                                        iter.remove();
                                        items.add(new Tuple2<ItemInfo, Integer>(inf.a, inf.b - stack.getAmount()));
                                    }
                                    transferItems.add(stack.clone());
                                    cartinventory.removeItem(stack);
                                }
                            }
                        }
                    }
View Full Code Here

                                            items.add(new Tuple2<ItemInfo, Integer>(inf.a, 0));
                                        } else {
                                            iter.remove();
                                            items.add(new Tuple2<ItemInfo, Integer>(inf.a, inf.b - stack.getAmount()));
                                        }
                                        transferitems.add(stack.clone());
                                        cartinventory.removeItem(stack);
                                    }
                                }
                        }
                    }
View Full Code Here

                if (AlchemyPotionBrewer.isValidIngredient(player, cursor)) {
                    int amount = cursor.getAmount();

                    if (click == ClickType.LEFT || (click == ClickType.RIGHT && amount == 1)) {
                        event.setCancelled(true);
                        event.setCurrentItem(cursor.clone());
                        event.setCursor(null);

                        AlchemyPotionBrewer.scheduleUpdate(inventory);
                        AlchemyPotionBrewer.scheduleCheck(player, stand);
                    }
View Full Code Here

    public boolean dispenseItem(Inventory inv, ItemStack old) {

        ItemStack item = old.clone();
        item.setAmount(amount);
        if (inv == null) return false;
        HashMap<Integer, ItemStack> over = inv.removeItem(item.clone());
        if (over.isEmpty()) {

            BlockFace back = SignUtil.getBack(BukkitUtil.toSign(getSign()).getBlock());
            Block pipe = getBackBlock().getRelative(back);
View Full Code Here

        if (over.isEmpty()) {

            BlockFace back = SignUtil.getBack(BukkitUtil.toSign(getSign()).getBlock());
            Block pipe = getBackBlock().getRelative(back);

            PipeRequestEvent event = new PipeRequestEvent(pipe, new ArrayList<ItemStack>(Arrays.asList(item.clone())), getBackBlock());
            Bukkit.getPluginManager().callEvent(event);

            if(!event.isValid())
                return true;
View Full Code Here

        int amountCursor = stackInSlot.getAmount() - amountSlot;
        if (stackInSlot.getAmount() == 1) {
          amountSlot = 0;
          amountCursor = 1;
        }
        stackOnCursor = stackInSlot.clone();
        stackOnCursor.setAmount(amountCursor);
        stackInSlot.setAmount(amountSlot);
        if (amountSlot == 0) {
          stackInSlot = new ItemStack(0);
        }
View Full Code Here

      i++;
    }
    // now get armor
    ItemStack stack = player.getInventory().getHelmet();
    if (stack != null)
      copiedInventory.add(new InventoryEntry(HELMET, stack.clone()));
    stack = player.getInventory().getChestplate();
    if (stack != null)
      copiedInventory.add(new InventoryEntry(CHESTPLATE, stack.clone()));
    stack = player.getInventory().getLeggings();
    if (stack != null)
View Full Code Here

    ItemStack stack = player.getInventory().getHelmet();
    if (stack != null)
      copiedInventory.add(new InventoryEntry(HELMET, stack.clone()));
    stack = player.getInventory().getChestplate();
    if (stack != null)
      copiedInventory.add(new InventoryEntry(CHESTPLATE, stack.clone()));
    stack = player.getInventory().getLeggings();
    if (stack != null)
      copiedInventory.add(new InventoryEntry(LEGGINGS, stack.clone()));
    stack = player.getInventory().getBoots();
    if (stack != null)
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.