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.
This commit is contained in:
Andreas Troelsen 2020-11-04 01:05:53 +01:00
parent 6c693294bd
commit 4ceb5b7bec

View File

@ -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