From 9bfcc83ba68812f94b10ae244b0a00c2dd70cde8 Mon Sep 17 00:00:00 2001 From: ceze88 Date: Thu, 18 Apr 2024 19:01:26 +0200 Subject: [PATCH] Fix role names in island settings --- src/main/java/com/craftaro/skyblock/island/Island.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/craftaro/skyblock/island/Island.java b/src/main/java/com/craftaro/skyblock/island/Island.java index c59babda..5b47886b 100644 --- a/src/main/java/com/craftaro/skyblock/island/Island.java +++ b/src/main/java/com/craftaro/skyblock/island/Island.java @@ -204,13 +204,14 @@ public Island(@Nonnull OfflinePlayer player) { for (BasicPermission permission : allPermissions) { if (settingsDataConfig == null || settingsDataConfig.getFileConfiguration() - .getString("Settings." + roleList.name() + "." + permission.getName()) == null) { + .getString("Settings." + roleList.getFriendlyName().toUpperCase(Locale.US) + "." + permission.getName()) == null) { + //save default value if not exist permissions.add( new IslandPermission(permission, this.plugin.getSettings() - .getBoolean("Settings." + roleList.name() + "." + permission.getName(), true))); + .getBoolean("Settings." + roleList.getFriendlyName().toUpperCase(Locale.US) + "." + permission.getName(), permission.getDefaultValues().get(roleList)))); } else { permissions.add(new IslandPermission(permission, settingsDataConfig.getFileConfiguration() - .getBoolean("Settings." + roleList.name() + "." + permission.getName(), true))); + .getBoolean("Settings." + roleList.getFriendlyName().toUpperCase(Locale.US) + "." + permission.getName(), true))); } }