mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Utility function extension
This commit is contained in:
parent
12b1016d66
commit
e328bf616f
@ -48,7 +48,7 @@ import java.io.File;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@Decree(name = "studio", aliases = {"std", "s"}, description = "Studio Commands", studio = true)
|
||||
public class DecIrisStudio implements DecreeExecutor {
|
||||
public class DecIrisStudio implements DecreeExecutor, DecreeStudioExtension {
|
||||
@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")
|
||||
@ -227,34 +227,4 @@ public class DecIrisStudio implements DecreeExecutor {
|
||||
Iris.proj.compilePackage(sender(), dimension, obfuscate, minify);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 & the player
|
||||
*/
|
||||
private boolean noStudio(){
|
||||
if (!sender().isPlayer()){
|
||||
error("Players only (this is a config error. Ask support to add DecreeOrigin.PLAYER)");
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,38 @@
|
||||
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 & the player
|
||||
*/
|
||||
default boolean noStudio(){
|
||||
if (!sender().isPlayer()){
|
||||
error("Players only (this is a config error. Ask support to add DecreeOrigin.PLAYER)");
|
||||
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;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user