Fix locate command (#6811)

This commit is contained in:
Cyborgmas 2020-06-25 21:42:01 -04:00 committed by GitHub
parent baf32612db
commit 8179a504cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,6 @@
--- a/net/minecraft/command/impl/LocateCommand.java
+++ b/net/minecraft/command/impl/LocateCommand.java
@@ -25,12 +25,19 @@
@@ -25,11 +25,18 @@
return p_198533_0_.func_197034_c(2);
});
@ -10,13 +10,12 @@
return func_241053_a_(p_241056_1_.getSource(), entry.getValue());
}));
}
+ else {
+ for (Structure<?> structureFeature : net.minecraftforge.registries.ForgeRegistries.STRUCTURE_FEATURES) {
+ String name = structureFeature.getRegistryName().toString().replace("minecraft:", "");
+ literalargumentbuilder = literalargumentbuilder.then(Commands.func_197057_a(name))
+ .executes(ctx -> func_241053_a_(ctx.getSource(), structureFeature));
+ }
+
+ literalargumentbuilder = literalargumentbuilder.then(Commands.func_197057_a(name)
+ .executes(ctx -> func_241053_a_(ctx.getSource(), structureFeature)));
+ }}
p_198528_0_.register(literalargumentbuilder);
}