Fix locale bug and parkour spawn position
- Fix locale 'true' bug with sanitization at all levels: * ConfigAccessor.getString() - force String.valueOf() * Option.java - sanitize LANG defaults from config * PlayerSettingsManager - sanitize on settings load * SQLDataMapper - sanitize on SQL load * StorageDisk - sanitize on JSON load * SQLMigrationManager - SQL migration to fix DB - Fix parkour first block position: * Island.java - spawn 6 blocks forward + 1 up from center * GeneratorCleanup.java - same position after fall/reset - Add spawn-location config option at top of config.yml
This commit is contained in:
parent
b0c03cd484
commit
3546d7f9e3
10 changed files with 154 additions and 272 deletions
|
|
@ -35,8 +35,13 @@ public class PlayerSettingsManager {
|
|||
p.selectedTime = parseIntSafe(v, defaultSelectedTime())));
|
||||
COLUMN_MAPPINGS.put("collectedRewards", new OptionContainer(null, PlayerSettingsManager::applyCollectedRewards));
|
||||
COLUMN_MAPPINGS.put("locale", new OptionContainer(ParkourOption.LANG, (p, v) -> {
|
||||
p._locale = v;
|
||||
p.locale = v;
|
||||
// Sanitize legacy Boolean values from old config parsing
|
||||
String sanitized = v;
|
||||
if ("true".equals(v) || "false".equals(v)) {
|
||||
sanitized = Option.OPTIONS_DEFAULTS.getOrDefault(ParkourOption.LANG, "en");
|
||||
}
|
||||
p._locale = sanitized;
|
||||
p.locale = sanitized;
|
||||
}));
|
||||
COLUMN_MAPPINGS.put("schematicDifficulty", new OptionContainer(ParkourOption.SCHEMATICS, (p, v) ->
|
||||
p.schematicDifficulty = parseDoubleSafe(v, defaultSchematicDifficulty())));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue