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);
}
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);
}
}
}
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);
}
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;
}
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;
}
Aggregations