mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-09-06 20:38:08 +02:00
Ignore _ when fuzzy searching enums.
This commit is contained in:
parent
6e8e59aee5
commit
cb0844c64d
@ -68,8 +68,9 @@ public static <T extends Enum<T>> T findFuzzyByValue(Class<T> enumType, String..
|
||||
checkNotNull(enumType);
|
||||
checkNotNull(values);
|
||||
for (String test : values) {
|
||||
test = test.replace("_", "");
|
||||
for (T value : enumType.getEnumConstants()) {
|
||||
if (value.name().equalsIgnoreCase(test)) {
|
||||
if (value.name().equalsIgnoreCase(test.replace("_", ""))) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user