Lower-case registry arguments in converter

Fixes #1542
This commit is contained in:
Octavia Togami 2020-09-29 17:37:56 -07:00
parent a1313a0edd
commit 8377a6bdac
No known key found for this signature in database
GPG Key ID: CC364524D1983C99

View File

@ -45,6 +45,7 @@
import java.lang.reflect.Field;
import java.util.List;
import java.util.Locale;
import java.util.stream.Collectors;
public final class RegistryConverter<V extends Keyed> implements ArgumentConverter<V> {
@ -98,7 +99,7 @@ public Component describeAcceptableArguments() {
@Override
public ConversionResult<V> convert(String argument, InjectedValueAccess injectedValueAccess) {
V result = registry.get(argument);
V result = registry.get(argument.toLowerCase(Locale.ROOT));
return result == null
? FailedConversion.from(new IllegalArgumentException(
"Not a valid " + registry.getName() + ": " + argument))