Fix ScriptListener
Fix RecordStatus
Dieser Commit ist enthalten in:
Ursprung
a7e45111f5
Commit
c4564e313a
@ -21,20 +21,18 @@ package de.steamwar.bausystem.tracer.record;
|
||||
|
||||
public enum RecordStatus {
|
||||
|
||||
RECORD("§aan", true,false, "§cTNT-Tracer muss gestoppt werden"),
|
||||
RECORD_AUTO("§aan", true, true, "§cTNT-Tracer darf nicht aufnehmen"),
|
||||
IDLE("§caus", false, false, "§cAuto-Tracer gestoppt"),
|
||||
IDLE_AUTO("§eauto", false, true, "§aAuto-Tracer gestartet");
|
||||
RECORD("§aan", true, "§cTNT-Tracer muss gestoppt werden"),
|
||||
RECORD_AUTO("§aan", true, "§cTNT-Tracer darf nicht aufnehmen"),
|
||||
IDLE("§caus", false, "§cAuto-Tracer gestoppt"),
|
||||
IDLE_AUTO("§eauto", false, "§aAuto-Tracer gestartet");
|
||||
|
||||
String name;
|
||||
boolean tracing;
|
||||
boolean autoTrace;
|
||||
String autoMessage;
|
||||
|
||||
RecordStatus(String value, boolean tracing, boolean autoTrace, String autoMessage) {
|
||||
RecordStatus(String value, boolean tracing, String autoMessage) {
|
||||
this.name = value;
|
||||
this.tracing = tracing;
|
||||
this.autoTrace = autoTrace;
|
||||
this.autoMessage = autoMessage;
|
||||
}
|
||||
|
||||
@ -47,7 +45,7 @@ public enum RecordStatus {
|
||||
}
|
||||
|
||||
public boolean isAutoTrace() {
|
||||
return autoTrace;
|
||||
return this == RECORD_AUTO || this == IDLE_AUTO;
|
||||
}
|
||||
|
||||
public String getAutoMessage() {
|
||||
|
@ -37,7 +37,6 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.BookMeta;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.IntBinaryOperator;
|
||||
import java.util.logging.Level;
|
||||
|
||||
@ -274,11 +273,11 @@ public class ScriptListener implements Listener {
|
||||
|
||||
private static void arithmeticCommand(ScriptExecutor scriptExecutor, String[] args, IntBinaryOperator operation) {
|
||||
if (args.length < 1) {
|
||||
scriptExecutor.player.sendMessage(BauSystem.PREFIX + "§cDas erste Argument ist eine Variable");
|
||||
scriptExecutor.player.sendMessage(BauSystem.PREFIX + "§cAls erstes Argument fehlt eine Variable");
|
||||
return;
|
||||
}
|
||||
if (args.length < 2) {
|
||||
scriptExecutor.player.sendMessage(BauSystem.PREFIX + "§cDas zweite Argument ist eine Zahl oder Variable");
|
||||
scriptExecutor.player.sendMessage(BauSystem.PREFIX + "§cAls zweites Argument fehlt eine Zahl oder Variable");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -322,7 +321,7 @@ public class ScriptListener implements Listener {
|
||||
switch (key) {
|
||||
case "trace":
|
||||
return RecordStateMachine.getRecordStatus().isTracing() ? 1 : 0;
|
||||
case "auto_trace":
|
||||
case "autotrace":
|
||||
return RecordStateMachine.getRecordStatus().isAutoTrace() ? 1 : 0;
|
||||
case "tnt":
|
||||
return region.getTntMode() == CommandTNT.TNTMode.OFF ? 0 : 1;
|
||||
@ -338,7 +337,7 @@ public class ScriptListener implements Listener {
|
||||
private static boolean isVariable(ScriptExecutor scriptExecutor, String key) {
|
||||
switch (key) {
|
||||
case "trace":
|
||||
case "auto_trace":
|
||||
case "autotrace":
|
||||
case "tnt":
|
||||
case "freeze":
|
||||
case "fire":
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren