mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-17 23:01:01 +01:00
#864: Fix Registry#match() failing namespaced inputs
By: Parker Hawke <hawkeboyz2@hotmail.com>
This commit is contained in:
parent
0e0920a058
commit
217583e495
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue