mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-02-19 13:51:24 +01:00
Enables mixed case enums to still be read from yaml config files
https://github.com/BentoBoxWorld/addon-challenges/issues/33
This commit is contained in:
parent
76483f7e39
commit
e23818f73d
@ -522,7 +522,7 @@ public class YamlDatabaseHandler<T> extends AbstractDatabaseHandler<T> {
|
|||||||
// Find out the value
|
// Find out the value
|
||||||
Class<Enum> enumClass = (Class<Enum>)clazz;
|
Class<Enum> enumClass = (Class<Enum>)clazz;
|
||||||
try {
|
try {
|
||||||
value = Enum.valueOf(enumClass, (String)value);
|
value = Enum.valueOf(enumClass, ((String)value).toUpperCase());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// This value does not exist - probably admin typed it wrongly
|
// This value does not exist - probably admin typed it wrongly
|
||||||
// Show what is available and pick one at random
|
// Show what is available and pick one at random
|
||||||
|
Loading…
Reference in New Issue
Block a user