Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. public void loadCoinFlipGui(Player player) {
  2. reloadConfig();
  3. ArrayList<ItemStack> guiItems = new ArrayList<ItemStack>();
  4.  
  5. Inventory gui = Bukkit.createInventory(player, 6 * 9,
  6. ChatColor.translateAlternateColorCodes('&', Main.getPlugin().getConfig().getString("prefix")));
  7. ConfigurationSection contents = Main.getPlugin().getConfig().getConfigurationSection("cf");
  8. for (String key : contents.getKeys(false)) {
  9.  
  10. ConfigurationSection contents2 = Main.getPlugin().getConfig().getConfigurationSection("cf." + key);
  11. for (String key2 : contents2.getKeys(false)) {
  12. List<Double> list = getConfig().getDoubleList("cf." + key + "." + key2);
  13. for (int i = 0; i < list.size(); i++) {
  14. ItemStack item = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
  15. SkullMeta skull = (SkullMeta) item.getItemMeta();
  16. skull.setDisplayName(key);
  17. ArrayList<String> lore = new ArrayList<String>();
  18. lore.add(key2);
  19. lore.add(list.get(i).toString());
  20.  
  21. skull.setLore(lore);
  22. skull.setOwner(player.getName());
  23. item.setItemMeta(skull);
  24. guiItems.add(item);
  25. }
  26.  
  27. }
  28.  
  29. }
  30. gui.setContents(guiItems.toArray(new ItemStack[0]));
  31. player.openInventory(gui);
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement