Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.83 KB | None | 0 0
  1.  
  2. //This one goes in the GuiInvItems class
  3. public static ItemStack givePlayerItem(Player p) {
  4.         ItemStack it = new ItemStack(Material.getMaterial(plugin.getConfig().getString("giveitem")));
  5.         ItemMeta itMeta = it.getItemMeta();
  6.         itMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("giveitemname")));
  7.         ArrayList<String> lore = new ArrayList<>();
  8.         List<String> stringList = plugin.getConfig().getStringList("giveitemlore");
  9.         IntStream.range(0, stringList.size()).forEach(i -> lore.add(getColor(stringList.get(i))));
  10.         itMeta.setLore(lore);
  11.         it.setItemMeta(itMeta);
  12.         return it;
  13.     }
  14.  
  15. //This one goes in the GUI command class
  16. GuiInvCreator.i.setItem(plugin.getConfig().getInt("giveitemlocation"), GuiInvItems.givePlayerItem(player));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement