Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void loadCoinFlipGui(Player player) {
- reloadConfig();
- ArrayList<ItemStack> guiItems = new ArrayList<ItemStack>();
- Inventory gui = Bukkit.createInventory(player, 6 * 9,
- ChatColor.translateAlternateColorCodes('&', Main.getPlugin().getConfig().getString("prefix")));
- ConfigurationSection contents = Main.getPlugin().getConfig().getConfigurationSection("cf");
- for (String key : contents.getKeys(false)) {
- ConfigurationSection contents2 = Main.getPlugin().getConfig().getConfigurationSection("cf." + key);
- for (String key2 : contents2.getKeys(false)) {
- List<Double> list = getConfig().getDoubleList("cf." + key + "." + key2);
- for (int i = 0; i < list.size(); i++) {
- ItemStack item = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
- SkullMeta skull = (SkullMeta) item.getItemMeta();
- skull.setDisplayName(key);
- ArrayList<String> lore = new ArrayList<String>();
- lore.add(key2);
- lore.add(list.get(i).toString());
- skull.setLore(lore);
- skull.setOwner(player.getName());
- item.setItemMeta(skull);
- guiItems.add(item);
- }
- }
- }
- gui.setContents(guiItems.toArray(new ItemStack[0]));
- player.openInventory(gui);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement