Merge pull request #700 from CocoTheOwner/allowMapVisionConsole

Allow consoles to open the vision gui
This commit is contained in:
Brian Fopiano 2021-12-26 18:16:58 -08:00 committed by GitHub
commit f1185d8f34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -402,12 +402,18 @@ public class CommandStudio implements DecreeExecutor {
}
@Decree(description = "Render a world map (External GUI)", aliases = "render")
public void map() {
if (noStudio()) return;
public void map(
@Param(name = "world", description = "The world to open the generator for", contextual = true)
World world
) {
if (noGUI()) return;
VisionGUI.launch(engine(), 0);
if (!IrisToolbelt.isIrisWorld(world)) {
sender().sendMessage(C.RED + "You need to be in or specify an Iris-generated world!");
return;
}
VisionGUI.launch(IrisToolbelt.access(world).getEngine(), 0);
sender().sendMessage(C.GREEN + "Opening map!");
}