Advertisement
broken-arrow

Untitled

Oct 29th, 2021
892
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.06 KB | None | 0 0
  1.     protected void loadSettingsFromYaml() {
  2.         Map<String, Guidata> yamlData = new HashMap<>();
  3.         ConfigurationSection MainConfigKeys = customConfig.getConfigurationSection("Gui_Templets");
  4.  
  5.         if (MainConfigKeys != null) {
  6.             for (String mainKey : MainConfigKeys.getKeys(false)) {
  7.                 ConfigurationSection innerConfigKeys = customConfig.getConfigurationSection("Gui_Templets." + mainKey);
  8.                 if (innerConfigKeys != null)
  9.                     for (String innerChildrenKeys : innerConfigKeys.getKeys(false)) {
  10.                         if (!innerChildrenKeys.equals("Menu_Size") && !innerChildrenKeys.equals("Menu_Title") && !innerChildrenKeys.equals("FillSpace")) {
  11.  
  12.                             int MenuGuiSize = this.customConfig.getInt("Gui_Templets." + mainKey + "." + "Menu_Size");
  13.                             String MenuGuiTitle = this.customConfig.getString("Gui_Templets." + mainKey + "." + "Menu_Title");
  14.                             String MenuFillSpace = this.customConfig.getString("Gui_Templets." + mainKey + "." + "FillSpace");
  15.                             int MenuMaxAmountOfItems = this.customConfig.getInt("Gui_Templets." + mainKey + "." + "Max_Amount_Of_Items");
  16.                             String playlistDisplayname = this.customConfig.getString("Gui_Templets." + mainKey + "." + innerChildrenKeys + ".Display_name");
  17.                             String playlistslot = this.customConfig.getString("Gui_Templets." + mainKey + "." + innerChildrenKeys + ".Slot");
  18.                             String playlistIcon = this.customConfig.getString("Gui_Templets." + mainKey + "." + innerChildrenKeys + ".Icon");
  19.                             boolean glow = this.customConfig.getBoolean("Gui_Templets." + mainKey + "." + innerChildrenKeys + ".Enchant");
  20.                             List<String> playlistLore = this.customConfig.getStringList("Gui_Templets." + mainKey + "." + innerChildrenKeys + ".Lore");
  21.  
  22.                             yamlData.put(mainKey + "_" + innerChildrenKeys, Guidata.of(glow, playlistDisplayname, playlistslot, playlistIcon, playlistLore));
  23.                             yamlData.put(mainKey, Guidata.of(MenuGuiTitle, MenuGuiSize, "", "", "", new ArrayList<>(), MenuFillSpace, MenuMaxAmountOfItems));
  24.  
  25.                             if (!yamlData.isEmpty()) {
  26.                                 setDataYamlfile(mainKey, yamlData);
  27.  
  28.                             }
  29.                         }
  30.                     }
  31.             }
  32.         }
  33.     }
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement