mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-19 02:36:59 +00:00
Simple null check
This commit is contained in:
parent
5a236e3bea
commit
11d0274a1b
@ -136,23 +136,14 @@ public class DecIris implements DecreeExecutor {
|
|||||||
|
|
||||||
@Decree(description = "Toggle debug")
|
@Decree(description = "Toggle debug")
|
||||||
public void debug(
|
public void debug(
|
||||||
@Param(name = "on", description = "Whether or not debug should be on", defaultValue = "toggle")
|
@Param(description = "Whether or not debug should be on", defaultValue = "toggle")
|
||||||
String on
|
Boolean on
|
||||||
) {
|
) {
|
||||||
Boolean val;
|
if (on == null){
|
||||||
if (on.equals("toggle") || on.equals("t")) {
|
on = !IrisSettings.get().getGeneral().isDebug();
|
||||||
val = !IrisSettings.get().getGeneral().isDebug();
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
val = (Boolean) DecreeSystem.getHandler(boolean.class).parse(on);
|
|
||||||
} catch (Throwable e){
|
|
||||||
sender().sendMessage(C.RED + "Failed to convert input: " + on + " to a true or false value");
|
|
||||||
Iris.reportError(e);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
sender().sendMessage(C.GREEN + "Set debug to " +val);
|
sender().sendMessage(C.GREEN + "Set debug to " + on);
|
||||||
IrisSettings.get().getGeneral().setDebug(val);
|
IrisSettings.get().getGeneral().setDebug(on);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Decree(description = "Download a project.", aliases = "dl")
|
@Decree(description = "Download a project.", aliases = "dl")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user