This commit is contained in:
Brianna 2019-08-24 14:55:03 -04:00
parent 4e5f8ddcda
commit c8e42ff9d1
2 changed files with 6 additions and 2 deletions

View File

@ -104,6 +104,10 @@ public class Config {
return null;
}
public List<Category> getCategories() {
return new ArrayList<>(categories.values());
}
public boolean hasCategory(String key) {
return getCategory(key) != null;
}

View File

@ -116,11 +116,11 @@ public class SettingsManager implements Listener {
Inventory inventory = Bukkit.createInventory(null, 27, plugin.getName() + " Settings Manager");
int slot = 10;
for (String key : config.getFileConfiguration().getDefaultSection().getKeys(false)) {
for (Category category : config.getCategories()) {
ItemStack item = new ItemStack(ServerVersion.isServerVersionAtLeast(ServerVersion.V1_13) ? Material.LEGACY_WOOL : Material.valueOf("WOOL"), 1, (byte) (slot - 9));
ItemMeta meta = item.getItemMeta();
meta.setLore(Collections.singletonList(Methods.formatText("&6Click To Edit This Category.")));
meta.setDisplayName(Methods.formatText("&f&l" + key));
meta.setDisplayName(Methods.formatText("&f&l" + category.getKey()));
item.setItemMeta(meta);
inventory.setItem(slot, item);
slot++;