From d2fbd40021b781d63c53aa92bdaa91de0f904001 Mon Sep 17 00:00:00 2001 From: N0tMyFaultOG Date: Fri, 13 Nov 2020 21:56:27 +0100 Subject: [PATCH] Lower-case registry arguments in converter 8377a6bdacb4d5e0b0af2d97e097e3d946cf1a0d Co-Authored-By: Octavia Togami <2093023+octylFractal@users.noreply.github.com> --- .../sk89q/worldedit/command/argument/RegistryConverter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/RegistryConverter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/RegistryConverter.java index f777c3a44..ad07203a6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/RegistryConverter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/RegistryConverter.java @@ -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 implements ArgumentConverter { @@ -98,7 +99,7 @@ public final class RegistryConverter implements ArgumentConvert @Override public ConversionResult 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))