Fix role names in island settings

This commit is contained in:
ceze88 2024-04-18 19:01:26 +02:00
parent 6e92c7fec9
commit 9bfcc83ba6

View File

@ -204,13 +204,14 @@ public class Island {
for (BasicPermission permission : allPermissions) { for (BasicPermission permission : allPermissions) {
if (settingsDataConfig == null || settingsDataConfig.getFileConfiguration() 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( permissions.add(
new IslandPermission(permission, this.plugin.getSettings() 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 { } else {
permissions.add(new IslandPermission(permission, settingsDataConfig.getFileConfiguration() permissions.add(new IslandPermission(permission, settingsDataConfig.getFileConfiguration()
.getBoolean("Settings." + roleList.name() + "." + permission.getName(), true))); .getBoolean("Settings." + roleList.getFriendlyName().toUpperCase(Locale.US) + "." + permission.getName(), true)));
} }
} }