public ItemStackBuilder lore(List<String> lore) { itemMeta.setLore(lore); return this; }
ItemStack wand = new ItemStack(Material.STICK); //create the ItemStack ItemMeta meta = wand.getItemMeta(); //get the ItemMeta List<String> lore = new ArrayList<String>(); //create a List<String> for the lore lore.add(ChatColor.GRAY + "Staff Wand"); //add "ยง7Staff Wand" to the lore meta.setLore(lore); //set the ItemMeta's lore to the List<String> wand.setItemMeta(meta); //set the ItemStack's meta.
public ItemBuilder setLore(List<String> lore) { final List<String> formatted = new ArrayList<>(); for (String str : lore) { formatted.add(ChatUtils.colored(str)); } this.itemMeta.setLore(formatted); this.refreshMeta(); return this; }
ItemStack i = new ItemStack(Material.PACKED_ICE); ItemMeta m = i.getItemMeta(); m.setDisplayName("CustomDisplayName") List<String> l = new ArrayList<String>(); l.add("Line 1"); l.add("Line 2"); m.setLore(l); i.setItemMeta(m); ShapedRecipe packedice = new ShapedRecipe(i);
@SuppressWarnings("unchecked") private void parseLore() { List<String> lores = new ArrayList<String>(); ItemMeta im = this.finalStack.getItemMeta(); for (Object lore : (List<String>) this.linkedSection.get("lore")) { lores.add(ChatColor.translateAlternateColorCodes('&', lore.toString())); } im.setLore(lores); this.finalStack.setItemMeta(im); }
@SuppressWarnings("unchecked") private void parseLore() { List<String> lores = new ArrayList<String>(); ItemMeta im = this.finalStack.getItemMeta(); for (Object lore : (List<String>) this.linkedSection.get("lore")) { lores.add(ChatColor.translateAlternateColorCodes('&', lore.toString())); } im.setLore(lores); this.finalStack.setItemMeta(im); }
public IconMaker setLore(List<String> lore) { List<String> colorLore = new ArrayList<>(); for (String l : lore) { colorLore.add(ChatColor.translateAlternateColorCodes('&', l)); } ItemMeta m = this.item.getItemMeta(); m.setLore(colorLore); this.item.setItemMeta(m); return this; }
public void removeSetting(String name){ ItemMeta meta = tool.getItemMeta(); List<String> lore = meta.getLore(); for (String l : new ArrayList<>(lore)) { if(ChatColor.stripColor(l).startsWith(name)){ lore.remove(l); break; } } meta.setLore(lore); tool.setItemMeta(meta); }
private void setPlay(Inventory inv, String str) { ItemStack play = inv.getItem(15); ItemMeta save = play.getItemMeta(); save.setLore(Collections.singletonList(str)); play.setItemMeta(save); }
private void setLore(Inventory inv, int slot, String str) { List<String> lore = (str != null) ? Collections.singletonList(str) : null; ItemStack is = inv.getItem(slot); ItemMeta im = is.getItemMeta(); im.setLore(lore); is.setItemMeta(im); } }
public ItemStackBuilder lore(String... lines) { return transformMeta(meta -> { List<String> lore = meta.getLore() == null ? new ArrayList<>() : meta.getLore(); for (String line : lines) { lore.add(Text.colorize(line)); } meta.setLore(lore); }); }
public ItemStackBuilder lore(String line) { return transformMeta(meta -> { List<String> lore = meta.getLore() == null ? new ArrayList<>() : meta.getLore(); lore.add(Text.colorize(line)); meta.setLore(lore); }); }
public ItemStackBuilder lore(String line) { return transformMeta(meta -> { List<String> lore = meta.getLore() == null ? new ArrayList<>() : meta.getLore(); lore.add(Text.colorize(line)); meta.setLore(lore); }); }
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; }
public void setMode(ToolMode mode){ ItemMeta meta = tool.getItemMeta(); List<String> lore = meta.getLore(); lore.set(1, ChatColor.AQUA + "Mode: " + ChatColor.WHITE + MinigameUtils.capitalize(mode.getName().replace("_", " "))); meta.setLore(lore); tool.setItemMeta(meta); this.mode = mode; }
public static ItemStack getChimaeraWing(int amount) { ItemStack itemStack = new ItemStack(Config.getInstance().getChimaeraItem(), amount); ItemMeta itemMeta = itemStack.getItemMeta(); itemMeta.setDisplayName(ChatColor.GOLD + LocaleLoader.getString("Item.ChimaeraWing.Name")); List<String> itemLore = new ArrayList<String>(); itemLore.add("mcMMO Item"); itemLore.add(LocaleLoader.getString("Item.ChimaeraWing.Lore")); itemMeta.setLore(itemLore); itemStack.setItemMeta(itemMeta); return itemStack; }
private ItemStack makeTool(Material mat, String name, String left, String right) { ItemStack tool = new ItemStack(mat); ItemMeta meta = tool.getItemMeta(); meta.setDisplayName(name); meta.setLore(Arrays.asList( color("&9Left&r: &r" + left), color("&cRight&r: &r" + right) )); tool.setItemMeta(meta); return tool; }
public ItemStack createItem(Material material, int amount, short datavalue, String name, List<String> lore) { ItemStack item = new ItemStack(material, amount, datavalue); ItemMeta meta = item.getItemMeta(); meta.setDisplayName(color(name)); meta.setLore(colorList(lore)); item.setItemMeta(meta); return item; }
public ItemBuilder colored() { if (itemMeta.hasDisplayName()) { itemMeta.setDisplayName(TLocale.Translate.setColored(itemMeta.getDisplayName())); } if (itemMeta.hasLore()) { itemMeta.setLore(TLocale.Translate.setColored(itemMeta.getLore())); } return this; }
public ItemStack createLazyItem(Material material, int amount, short datavalue, String name, String lore) { ItemStack item = new ItemStack(material, amount, datavalue); ItemMeta meta = item.getItemMeta(); meta.setDisplayName(color(SavageFactions.plugin.getConfig().getString(name))); meta.setLore(colorList(SavageFactions.plugin.getConfig().getStringList(lore))); item.setItemMeta(meta); return item; }