mirror of
https://github.com/songoda/SongodaCore.git
synced 2025-02-20 05:21:22 +01:00
Confiigg
This commit is contained in:
parent
4e5f8ddcda
commit
c8e42ff9d1
@ -104,6 +104,10 @@ public class Config {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Category> getCategories() {
|
||||||
|
return new ArrayList<>(categories.values());
|
||||||
|
}
|
||||||
|
|
||||||
public boolean hasCategory(String key) {
|
public boolean hasCategory(String key) {
|
||||||
return getCategory(key) != null;
|
return getCategory(key) != null;
|
||||||
}
|
}
|
||||||
|
@ -116,11 +116,11 @@ public class SettingsManager implements Listener {
|
|||||||
Inventory inventory = Bukkit.createInventory(null, 27, plugin.getName() + " Settings Manager");
|
Inventory inventory = Bukkit.createInventory(null, 27, plugin.getName() + " Settings Manager");
|
||||||
|
|
||||||
int slot = 10;
|
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));
|
ItemStack item = new ItemStack(ServerVersion.isServerVersionAtLeast(ServerVersion.V1_13) ? Material.LEGACY_WOOL : Material.valueOf("WOOL"), 1, (byte) (slot - 9));
|
||||||
ItemMeta meta = item.getItemMeta();
|
ItemMeta meta = item.getItemMeta();
|
||||||
meta.setLore(Collections.singletonList(Methods.formatText("&6Click To Edit This Category.")));
|
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);
|
item.setItemMeta(meta);
|
||||||
inventory.setItem(slot, item);
|
inventory.setItem(slot, item);
|
||||||
slot++;
|
slot++;
|
||||||
|
Loading…
Reference in New Issue
Block a user