From 91cf10541bdf8c1a083edf3f089474bd972cdd59 Mon Sep 17 00:00:00 2001 From: CocoTheOwner Date: Sun, 15 Aug 2021 21:49:03 +0200 Subject: [PATCH] Four - remove decreeExtension --- .../iris/core/decrees/DecIrisStudio.java | 36 ++++++++++++++++-- .../core/decrees/DecreeStudioExtension.java | 38 ------------------- 2 files changed, 33 insertions(+), 41 deletions(-) delete mode 100644 src/main/java/com/volmit/iris/core/decrees/DecreeStudioExtension.java diff --git a/src/main/java/com/volmit/iris/core/decrees/DecIrisStudio.java b/src/main/java/com/volmit/iris/core/decrees/DecIrisStudio.java index 557a0e751..0b551c4bf 100644 --- a/src/main/java/com/volmit/iris/core/decrees/DecIrisStudio.java +++ b/src/main/java/com/volmit/iris/core/decrees/DecIrisStudio.java @@ -19,6 +19,7 @@ package com.volmit.iris.core.decrees; import com.volmit.iris.Iris; +import com.volmit.iris.core.IrisSettings; import com.volmit.iris.core.gui.NoiseExplorerGUI; import com.volmit.iris.core.gui.VisionGUI; import com.volmit.iris.core.project.IrisProject; @@ -55,9 +56,7 @@ import com.volmit.iris.util.json.JSONCleaner; import com.volmit.iris.util.json.JSONObject; import com.volmit.iris.util.math.RNG; import com.volmit.iris.util.noise.CNG; -import com.volmit.iris.util.parallel.BurstExecutor; import com.volmit.iris.util.parallel.MultiBurst; -import com.volmit.iris.util.scheduling.ChronoLatch; import com.volmit.iris.util.scheduling.J; import com.volmit.iris.util.scheduling.O; import com.volmit.iris.util.scheduling.PrecisionStopwatch; @@ -78,7 +77,7 @@ import java.util.concurrent.ExecutionException; import java.util.function.Supplier; @Decree(name = "studio", aliases = {"std", "s"}, description = "Studio Commands", studio = true) -public class DecIrisStudio implements DecreeExecutor, DecreeStudioExtension { +public class DecIrisStudio implements DecreeExecutor { @Decree(description = "Open a new studio world", aliases = "o", sync = true) public void open( @Param(name = "dimension", defaultValue = "overworld", description = "The dimension to open a studio for", aliases = "dim") @@ -708,4 +707,35 @@ public class DecIrisStudio implements DecreeExecutor, DecreeStudioExtension { error("Invalid project: " + dimension.getName() + ". Try deleting the code-workspace file and try again."); } } + + + /** + * @return true if server GUIs are not enabled + */ + private boolean noGUI() { + if (!IrisSettings.get().isUseServerLaunchedGuis()){ + error("You must have server launched GUIs enabled in the settings!"); + return true; + } + return false; + } + + /** + * @return true if no studio is open or the player is not in one + */ + private boolean noStudio(){ + if (!sender().isPlayer()){ + error("Players only (this is a config error. Ask support to add DecreeOrigin.PLAYER to the command you tried to run)"); + return true; + } + if (!Iris.proj.isProjectOpen()){ + error("No studio world is open!"); + return true; + } + if (!engine().isStudio()){ + error("You must be in a studio world!"); + return true; + } + return false; + } } diff --git a/src/main/java/com/volmit/iris/core/decrees/DecreeStudioExtension.java b/src/main/java/com/volmit/iris/core/decrees/DecreeStudioExtension.java deleted file mode 100644 index cb03f78cd..000000000 --- a/src/main/java/com/volmit/iris/core/decrees/DecreeStudioExtension.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.volmit.iris.core.decrees; - -import com.volmit.iris.Iris; -import com.volmit.iris.core.IrisSettings; -import com.volmit.iris.util.decree.DecreeExecutor; - -public interface DecreeStudioExtension extends DecreeExecutor { - - /** - * @return true if server GUIs are not enabled - */ - default boolean noGUI() { - if (!IrisSettings.get().isUseServerLaunchedGuis()){ - error("You must have server launched GUIs enabled in the settings!"); - return true; - } - return false; - } - - /** - * @return true if no studio is open or the player is not in one - */ - default boolean noStudio(){ - if (!sender().isPlayer()){ - error("Players only (this is a config error. Ask support to add DecreeOrigin.PLAYER to the command you tried to run)"); - return true; - } - if (!Iris.proj.isProjectOpen()){ - error("No studio world is open!"); - return true; - } - if (!engine().isStudio()){ - error("You must be in a studio world!"); - return true; - } - return false; - } -}