Fix string conversion to upper case

This commit is contained in:
ceze88 2024-04-12 18:34:49 +02:00
parent a48aa0cec8
commit 4b7f63b024
2 changed files with 6 additions and 4 deletions

View File

@ -46,6 +46,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Objects;
@ -203,13 +204,13 @@ public class Island {
for (BasicPermission permission : allPermissions) {
if (settingsDataConfig == null || settingsDataConfig.getFileConfiguration()
.getString("Settings." + roleList.getFriendlyName().toUpperCase() + "." + permission.getName()) == null) {
.getString("Settings." + roleList.name() + "." + permission.getName()) == null) {
permissions.add(
new IslandPermission(permission, this.plugin.getSettings()
.getBoolean("Settings." + roleList.getFriendlyName().toUpperCase() + "." + permission.getName(), true)));
.getBoolean("Settings." + roleList.name() + "." + permission.getName(), true)));
} else {
permissions.add(new IslandPermission(permission, settingsDataConfig.getFileConfiguration()
.getBoolean("Settings." + roleList.getFriendlyName().toUpperCase() + "." + permission.getName(), true)));
.getBoolean("Settings." + roleList.name() + "." + permission.getName(), true)));
}
}

View File

@ -4,6 +4,7 @@ import com.craftaro.skyblock.localization.type.Localization;
import org.bukkit.configuration.ConfigurationSection;
import java.util.EnumMap;
import java.util.Locale;
import java.util.Map;
public class EnumLocalization<T extends Enum<T>> extends Localization<T> {
@ -37,6 +38,6 @@ public class EnumLocalization<T extends Enum<T>> extends Localization<T> {
}
protected T parseEnum(String input) {
return Enum.valueOf(getType(), input.toUpperCase());
return Enum.valueOf(getType(), input.toUpperCase(Locale.US));
}
}