Package org.bukkit.inventory

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


   
    if (result != null){
      // Check that the player has the correct amount of items
      if (inv.contains(itemHand.getTypeId())){
        // Remove the item using the type id, amount and durability (damage value)
        inv.removeItem(new ItemStack(itemHand.getTypeId(), amount, itemHand.getDurability()));
        inv.addItem(new ItemStack(result.getTypeId(), amount));
        LogHelper.showInfo("smeltSuccess#####[ " + Utils.userFriendlyNames(itemHand.getType().name()), player, ChatColor.GREEN);
      } else {
        LogHelper.showInfo("smeltNotEnough#####[ " + Utils.userFriendlyNames(itemHand.getType().name()), player, ChatColor.RED);
      }
View Full Code Here


              || !item.getItemMeta().hasDisplayName()
              || item.getItemMeta().getDisplayName()
                  .contains(ChatColor.MAGIC.toString())) {
            item = plugin.getDropAPI().getItem(tool);
          }
          pi.removeItem(tool);
          pi.addItem(item);
          p.sendMessage(ChatColor.GREEN
              + "You have identified an item!");
          p.updateInventory();
          e.setUseItemInHand(Result.DENY);
View Full Code Here

        if (repairMaterialMetadata == -1) {
            toRemove = inventory.getItem(inventory.first(repairMaterial)).clone();
            toRemove.setAmount(1);
        }

        inventory.removeItem(toRemove);

        // Give out XP like candy
        applyXpGain((float) ((getPercentageRepaired(startDurability, newDurability, repairable.getMaximumDurability()) * repairable.getXpMultiplier()) * ExperienceConfig.getInstance().getRepairXPBase() * ExperienceConfig.getInstance().getRepairXP(repairable.getRepairMaterialType())), XPGainReason.PVE);

        // BWONG BWONG BWONG
View Full Code Here

        if (!playerInventory.containsAtLeast(seed, 1)) {
            player.sendMessage(LocaleLoader.getString("Herbalism.Ability.GTe.NeedMore"));
            return false;
        }

        playerInventory.removeItem(seed);
        player.updateInventory(); // Needed until replacement available

        return Herbalism.convertGreenTerraBlocks(blockState);
    }
View Full Code Here

        if (!playerInventory.contains(Material.RED_MUSHROOM)) {
            player.sendMessage(LocaleLoader.getString("Skills.NeedMore", StringUtils.getPrettyItemString(Material.RED_MUSHROOM)));
            return false;
        }

        playerInventory.removeItem(new ItemStack(Material.BROWN_MUSHROOM));
        playerInventory.removeItem(new ItemStack(Material.RED_MUSHROOM));
        player.updateInventory();

        if (!SkillUtils.activationSuccessful(SecondaryAbility.SHROOM_THUMB, getPlayer(), getSkillLevel(), activationChance)) {
            player.sendMessage(LocaleLoader.getString("Herbalism.Ability.ShroomThumb.Fail"));
View Full Code Here

            player.sendMessage(LocaleLoader.getString("Skills.NeedMore", StringUtils.getPrettyItemString(Material.RED_MUSHROOM)));
            return false;
        }

        playerInventory.removeItem(new ItemStack(Material.BROWN_MUSHROOM));
        playerInventory.removeItem(new ItemStack(Material.RED_MUSHROOM));
        player.updateInventory();

        if (!SkillUtils.activationSuccessful(SecondaryAbility.SHROOM_THUMB, getPlayer(), getSkillLevel(), activationChance)) {
            player.sendMessage(LocaleLoader.getString("Herbalism.Ability.ShroomThumb.Fail"));
            return false;
View Full Code Here

        if (!handleBlockState(blockState, greenTerra)) {
            return;
        }

        playerInventory.removeItem(seed);
        player.updateInventory(); // Needed until replacement available
        new HerbalismBlockUpdaterTask(blockState).runTaskLater(mcMMO.p, 0);
    }

    private boolean handleBlockState(BlockState blockState, boolean greenTerra) {
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.