Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //This one goes in the GuiInvItems class
- public static ItemStack givePlayerItem(Player p) {
- ItemStack it = new ItemStack(Material.getMaterial(plugin.getConfig().getString("giveitem")));
- ItemMeta itMeta = it.getItemMeta();
- itMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("giveitemname")));
- ArrayList<String> lore = new ArrayList<>();
- List<String> stringList = plugin.getConfig().getStringList("giveitemlore");
- IntStream.range(0, stringList.size()).forEach(i -> lore.add(getColor(stringList.get(i))));
- itMeta.setLore(lore);
- it.setItemMeta(itMeta);
- return it;
- }
- //This one goes in the GUI command class
- GuiInvCreator.i.setItem(plugin.getConfig().getInt("giveitemlocation"), GuiInvItems.givePlayerItem(player));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement