mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 12:42:05 -07:00
More 1.19.3 registry fun (#8618)
This commit is contained in:
@@ -302,7 +302,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+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..00000000000000000000000000000000
|
||||
+ 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..00000000000000000000000000000000
|
||||
+ 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()) {
|
||||
|
Reference in New Issue
Block a user