Search in sources :

Example 11 with ItemMeta

use of org.bukkit.inventory.meta.ItemMeta in project Minigames by AddstarMC.

the class MenuItem method setDescription.

public void setDescription(List<String> description) {
    ItemMeta meta = displayItem.getItemMeta();
    meta.setLore(description);
    displayItem.setItemMeta(meta);
}
Also used : ItemMeta(org.bukkit.inventory.meta.ItemMeta)

Example 12 with ItemMeta

use of org.bukkit.inventory.meta.ItemMeta in project Minigames by AddstarMC.

the class GiveItemAction method execute.

private void execute(MinigamePlayer player) {
    ItemStack item = new ItemStack(Material.getMaterial(type.getFlag()), count.getFlag(), damage.getFlag().shortValue());
    ItemMeta meta = item.getItemMeta();
    if (name.getFlag() != null) {
        meta.setDisplayName(name.getFlag());
    }
    if (lore.getFlag() != null) {
        meta.setLore(MinigameUtils.stringToList(lore.getFlag()));
    }
    item.setItemMeta(meta);
    Map<Integer, ItemStack> unadded = player.getPlayer().getInventory().addItem(item);
    if (!unadded.isEmpty()) {
        for (ItemStack i : unadded.values()) {
            player.getLocation().getWorld().dropItem(player.getLocation(), i);
        }
    }
}
Also used : ItemStack(org.bukkit.inventory.ItemStack) ItemMeta(org.bukkit.inventory.meta.ItemMeta)

Example 13 with ItemMeta

use of org.bukkit.inventory.meta.ItemMeta in project Minigames by AddstarMC.

the class MinigameTool method addSetting.

public void addSetting(String name, String setting) {
    ItemMeta meta = tool.getItemMeta();
    List<String> lore = meta.getLore();
    lore.add(ChatColor.AQUA + name + ": " + ChatColor.WHITE + setting);
    meta.setLore(lore);
    tool.setItemMeta(meta);
}
Also used : ItemMeta(org.bukkit.inventory.meta.ItemMeta)

Example 14 with ItemMeta

use of org.bukkit.inventory.meta.ItemMeta in project Minigames by AddstarMC.

the class MinigameTool method setMinigame.

public void setMinigame(Minigame minigame) {
    ItemMeta meta = tool.getItemMeta();
    List<String> lore = meta.getLore();
    lore.set(0, ChatColor.AQUA + "Minigame: " + ChatColor.WHITE + minigame.getName(false));
    meta.setLore(lore);
    tool.setItemMeta(meta);
    this.minigame = minigame;
}
Also used : ItemMeta(org.bukkit.inventory.meta.ItemMeta)

Example 15 with ItemMeta

use of org.bukkit.inventory.meta.ItemMeta in project Minigames by AddstarMC.

the class MinigameTool method setTeam.

public void setTeam(TeamColor color) {
    ItemMeta meta = tool.getItemMeta();
    List<String> lore = meta.getLore();
    if (color == null) {
        lore.set(2, ChatColor.AQUA + "Team: " + ChatColor.WHITE + "None");
    } else {
        lore.set(2, ChatColor.AQUA + "Team: " + color.getColor() + MinigameUtils.capitalize(color.toString().replace("_", " ")));
    }
    meta.setLore(lore);
    tool.setItemMeta(meta);
    team = color;
}
Also used : ItemMeta(org.bukkit.inventory.meta.ItemMeta)

Aggregations

ItemMeta (org.bukkit.inventory.meta.ItemMeta)47 ItemStack (org.bukkit.inventory.ItemStack)17 ArrayList (java.util.ArrayList)5 Enchantment (org.bukkit.enchantments.Enchantment)5 net.aufdemrand.denizencore.objects.dList (net.aufdemrand.denizencore.objects.dList)4 BookMeta (org.bukkit.inventory.meta.BookMeta)3 FireworkEffectMeta (org.bukkit.inventory.meta.FireworkEffectMeta)3 SkullMeta (org.bukkit.inventory.meta.SkullMeta)3 LinkedHashMap (java.util.LinkedHashMap)2 List (java.util.List)2 StringTag (net.aufdemrand.denizen.nms.util.jnbt.StringTag)2 Element (net.aufdemrand.denizencore.objects.Element)2 FireworkEffect (org.bukkit.FireworkEffect)2 Material (org.bukkit.Material)2 Banner (org.bukkit.block.Banner)2 BannerMeta (org.bukkit.inventory.meta.BannerMeta)2 BlockStateMeta (org.bukkit.inventory.meta.BlockStateMeta)2 EnchantmentStorageMeta (org.bukkit.inventory.meta.EnchantmentStorageMeta)2 LeatherArmorMeta (org.bukkit.inventory.meta.LeatherArmorMeta)2 RewardType (au.com.mineauz.minigames.minigame.reward.RewardType)1