Force getString() for locale default to prevent Boolean parsing

Config.get() was returning Boolean true instead of String "en",
causing locale lookup to fail. Now using getString() directly.
This commit is contained in:
loki 2026-04-09 13:00:32 +02:00
parent 2f63b14d11
commit 6e0f0e4327

View file

@ -263,15 +263,16 @@ public class Option {
String defaultPath = parent + ".default";
if (Config.CONFIG.isPath(defaultPath)) {
Object value = Config.CONFIG.get(defaultPath);
// Always read as String to avoid Boolean parsing issues
String value = Config.CONFIG.getString(defaultPath);
// Debug logging
if (option == ParkourOption.LANG) {
LoParkour.getPlugin().getLogger().info("LANG option: path=" + defaultPath + ", value=" + value + ", type=" + (value != null ? value.getClass().getSimpleName() : "null"));
LoParkour.getPlugin().getLogger().info("LANG option: path=" + defaultPath + ", value=" + value);
}
if (value != null) {
OPTIONS_DEFAULTS.put(option, String.valueOf(value));
if (value != null && !value.isEmpty()) {
OPTIONS_DEFAULTS.put(option, value);
}
} else {
// Debug: path not found