From 4ceb5b7bec72180d08308cf4b372e3e2a3e5573c Mon Sep 17 00:00:00 2001 From: Andreas Troelsen Date: Wed, 4 Nov 2020 01:05:53 +0100 Subject: [PATCH] Allow use of "config name" in `default-class`. This is a very simple change that could potentially save a lot of headaches when people look elsewhere in their config-file and see a class name like "Big Gary" and wonder why putting that value in the `default-class` property won't work. --- src/main/java/com/garbagemule/MobArena/ArenaImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/garbagemule/MobArena/ArenaImpl.java b/src/main/java/com/garbagemule/MobArena/ArenaImpl.java index f67b611..34d9e98 100644 --- a/src/main/java/com/garbagemule/MobArena/ArenaImpl.java +++ b/src/main/java/com/garbagemule/MobArena/ArenaImpl.java @@ -191,7 +191,8 @@ public class ArenaImpl implements Arena String defaultClassName = settings.getString("default-class", null); if (defaultClassName != null) { - this.defaultClass = classes.get(defaultClassName); + String slug = Slugs.create(defaultClassName); + this.defaultClass = classes.get(slug); } // Blocks and pets