Use toUpperCase() in SetPlayerTime step.

This commit fixes the `player-time-in-arena` per-arena setting by switching to `toUpperCase()` on the string value, which means that the values can actually result in something meaningful, rather than always throwing an exception.

The feature was broken in commit b1c6b61827, and it appears to be the only such instance to sneak through.

Fixes #621

Co-authored-by: Bobcat00 <Bobcat00@users.noreply.github.com>
Co-authored-by: Chew <chew@chew.pw>
This commit is contained in:
Andreas Troelsen 2020-05-17 08:15:05 +02:00
parent 58cb29ae97
commit 62496127d7
2 changed files with 2 additions and 1 deletions

View File

@ -17,6 +17,7 @@ These changes will (most likely) be included in the next version.
- Boss names now support color codes. - Boss names now support color codes.
- The Root Target ability now uses potion effects (slowness, slow falling, and negative jump boost) instead of repeated teleports. This should make for a smoother root experience. - The Root Target ability now uses potion effects (slowness, slow falling, and negative jump boost) instead of repeated teleports. This should make for a smoother root experience.
- Config-files with missing `pet-items` nodes no longer errors. A missing `pet-items` node in `global-settings` is treated as empty, i.e. no pet items will be registered. - Config-files with missing `pet-items` nodes no longer errors. A missing `pet-items` node in `global-settings` is treated as empty, i.e. no pet items will be registered.
- The `player-time-in-arena` setting has been fixed.
## [0.104.2] - 2020-01-03 ## [0.104.2] - 2020-01-03
- The region overlap check now works across both arena and lobby regions, i.e. all four combinations of intersections between two regions (arena-arena, arena-lobby, lobby-arena, and lobby-lobby) are evaluated. - The region overlap check now works across both arena and lobby regions, i.e. all four combinations of intersections between two regions (arena-arena, arena-lobby, lobby-arena, and lobby-lobby) are evaluated.

View File

@ -34,7 +34,7 @@ class SetPlayerTime extends PlayerStep {
private static Time parseTime(ConfigurationSection settings) { private static Time parseTime(ConfigurationSection settings) {
String value = settings.getString("player-time-in-arena", "world"); String value = settings.getString("player-time-in-arena", "world");
try { try {
return Time.valueOf(value.toLowerCase()); return Time.valueOf(value.toUpperCase());
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
return null; return null;
} }