Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ArrayList<ItemStack> guiItems = new ArrayList<ItemStack>();
- Player player = (Player) sender;
- Inventory gui = Bukkit.createInventory(player, Main.getPlugin().getConfig().getInt("size"),
- ChatColor.translateAlternateColorCodes('&', Main.getPlugin().getConfig().getString("title")));
- ConfigurationSection contents = Main.getPlugin().getConfig().getConfigurationSection("contents");
- for (String key : contents.getKeys(false)) {
- ItemStack item = new ItemStack(
- Material.getMaterial(Main.getPlugin().getConfig().getString("contents." + key + ".item")));
- ItemMeta meta = item.getItemMeta();
- meta.setDisplayName(ChatColor.translateAlternateColorCodes('&',
- Main.getPlugin().getConfig().getString("contents." + key + ".name")));
- List<String> lore = Main.getPlugin().getConfig().getStringList("contents." + key + ".lore");
- meta.setLore(lore);
- item.setItemMeta(meta);
- guiItems.add(item);
- }
- guiItems.toArray();
- gui.setContents(guiItems);
- player.openInventory(gui);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement