mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-19 22:33:48 -07:00
#864: Fix Registry#match() failing namespaced inputs
By: Parker Hawke <hawkeboyz2@hotmail.com>
This commit is contained in:
@@ -253,7 +253,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
|
|||||||
default T match(@NotNull String input) {
|
default T match(@NotNull String input) {
|
||||||
Preconditions.checkArgument(input != null, "input must not be null");
|
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);
|
NamespacedKey namespacedKey = NamespacedKey.fromString(filtered);
|
||||||
return (namespacedKey != null) ? get(namespacedKey) : null;
|
return (namespacedKey != null) ? get(namespacedKey) : null;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user