From 62496127d7412b2c3ac8dc40f60185a7d9644e30 Mon Sep 17 00:00:00 2001 From: Andreas Troelsen Date: Sun, 17 May 2020 08:15:05 +0200 Subject: [PATCH] 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 b1c6b618279fd181799aeafdb041ad2d1775a585, and it appears to be the only such instance to sneak through. Fixes #621 Co-authored-by: Bobcat00 Co-authored-by: Chew --- changelog.md | 1 + src/main/java/com/garbagemule/MobArena/steps/SetPlayerTime.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index b164870..6bddabc 100644 --- a/changelog.md +++ b/changelog.md @@ -17,6 +17,7 @@ These changes will (most likely) be included in the next version. - 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. - 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 - 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. diff --git a/src/main/java/com/garbagemule/MobArena/steps/SetPlayerTime.java b/src/main/java/com/garbagemule/MobArena/steps/SetPlayerTime.java index f0a0a3b..33c2721 100644 --- a/src/main/java/com/garbagemule/MobArena/steps/SetPlayerTime.java +++ b/src/main/java/com/garbagemule/MobArena/steps/SetPlayerTime.java @@ -34,7 +34,7 @@ class SetPlayerTime extends PlayerStep { private static Time parseTime(ConfigurationSection settings) { String value = settings.getString("player-time-in-arena", "world"); try { - return Time.valueOf(value.toLowerCase()); + return Time.valueOf(value.toUpperCase()); } catch (IllegalArgumentException e) { return null; }