More 1.19.3 registry fun (#8618)
This commit is contained in:
parent
7414739946
commit
7aa90a8535
8 changed files with 28 additions and 27 deletions
|
@ -287,7 +287,7 @@ index 0000000000000000000000000000000000000000..6ff5d42a866d2752c73a766815aa190b
|
|||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/command/subcommands/EntityCommand.java b/src/main/java/io/papermc/paper/command/subcommands/EntityCommand.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..68f99e93ed3e843b4001a7a27620f88a48b85e67
|
||||
index 0000000000000000000000000000000000000000..9e51b3d1217ad6dc5c0c11d2febac7144e5721af
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/command/subcommands/EntityCommand.java
|
||||
@@ -0,0 +1,145 @@
|
||||
|
@ -302,7 +302,7 @@ index 0000000000000000000000000000000000000000..68f99e93ed3e843b4001a7a27620f88a
|
|||
+import java.util.Map;
|
||||
+import java.util.Set;
|
||||
+import java.util.stream.Collectors;
|
||||
+import net.minecraft.core.Registry;
|
||||
+import net.minecraft.core.registries.BuiltInRegistries;
|
||||
+import net.minecraft.resources.ResourceLocation;
|
||||
+import net.minecraft.server.level.ServerChunkCache;
|
||||
+import net.minecraft.server.level.ServerLevel;
|
||||
|
@ -335,7 +335,7 @@ index 0000000000000000000000000000000000000000..68f99e93ed3e843b4001a7a27620f88a
|
|||
+ if (args.length == 1) {
|
||||
+ return CommandUtil.getListMatchingLast(sender, args, "help", "list");
|
||||
+ } else if (args.length == 2) {
|
||||
+ return CommandUtil.getListMatchingLast(sender, args, Registry.ENTITY_TYPE.keySet().stream().map(ResourceLocation::toString).sorted().toArray(String[]::new));
|
||||
+ return CommandUtil.getListMatchingLast(sender, args, BuiltInRegistries.ENTITY_TYPE.keySet().stream().map(ResourceLocation::toString).sorted().toArray(String[]::new));
|
||||
+ }
|
||||
+ return Collections.emptyList();
|
||||
+ }
|
||||
|
@ -360,7 +360,7 @@ index 0000000000000000000000000000000000000000..68f99e93ed3e843b4001a7a27620f88a
|
|||
+ filter = args[1];
|
||||
+ }
|
||||
+ final String cleanfilter = filter.replace("?", ".?").replace("*", ".*?");
|
||||
+ Set<ResourceLocation> names = Registry.ENTITY_TYPE.keySet().stream()
|
||||
+ Set<ResourceLocation> names = BuiltInRegistries.ENTITY_TYPE.keySet().stream()
|
||||
+ .filter(n -> n.toString().matches(cleanfilter))
|
||||
+ .collect(Collectors.toSet());
|
||||
+ if (names.isEmpty()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue