From d343cd4f089dfa34821b32044554b592250d7c5d Mon Sep 17 00:00:00 2001 From: CocoTheOwner Date: Thu, 18 Nov 2021 15:09:41 +0100 Subject: [PATCH] Allow consoles to open the vision gui --- .../volmit/iris/core/commands/CommandStudio.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/volmit/iris/core/commands/CommandStudio.java b/src/main/java/com/volmit/iris/core/commands/CommandStudio.java index 79f79c808..f46a6725c 100644 --- a/src/main/java/com/volmit/iris/core/commands/CommandStudio.java +++ b/src/main/java/com/volmit/iris/core/commands/CommandStudio.java @@ -419,12 +419,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!"); }