#864: Fix Registry#match() failing namespaced inputs

By: Parker Hawke <hawkeboyz2@hotmail.com>
This commit is contained in:
Bukkit/Spigot 2023-06-04 11:28:04 +10:00
parent 0e0920a058
commit 217583e495

View file

@ -253,7 +253,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
default T match(@NotNull String input) {
Preconditions.checkArgument(input != null, "input must not be null");
String filtered = input.toLowerCase().replaceAll("\\s+", "_").replaceAll("\\W", "");
String filtered = input.toLowerCase().replaceAll("\\s+", "_");
NamespacedKey namespacedKey = NamespacedKey.fromString(filtered);
return (namespacedKey != null) ? get(namespacedKey) : null;
}