Lower-case registry arguments in converter

8377a6bdacb4d5e0b0af2d97e097e3d946cf1a0d

Co-Authored-By: Octavia Togami <2093023+octylFractal@users.noreply.github.com>
This commit is contained in:
N0tMyFaultOG 2020-11-13 21:56:27 +01:00
parent 0d2c4c0825
commit d2fbd40021

View File

@ -45,6 +45,7 @@ import org.enginehub.piston.inject.Key;
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 final class RegistryConverter<V extends Keyed> implements ArgumentConvert
@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))