TntMode #163
@ -34,7 +34,7 @@ public class CommandInfo implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
sender.sendMessage(BauSystem.PREFIX + "Besitzer: §e" + SteamwarUser.get(BauSystem.getOwnerID()).getUserName());
|
||||
sender.sendMessage(BauSystem.PREFIX + "TNT-Schaden: " + (CommandTNT.getInstance().isOn() ? "§aAUS" : "§cAN"));
|
||||
sender.sendMessage(BauSystem.PREFIX + "TNT-Schaden: " + (CommandTNT.getTntMode() == CommandTNT.TNTMode.OFF ? "§cAN" : "§aAUS"));
|
||||
sender.sendMessage(BauSystem.PREFIX + "Feuerschaden: " + (CommandFire.getInstance().isOn() ? "§aAUS" : "§cAN"));
|
||||
sender.sendMessage(BauSystem.PREFIX + "Eingefroren: " + (CommandFreeze.getInstance().isOn() ? "§aJA" : "§cNEIN"));
|
||||
|
||||
|
@ -68,11 +68,11 @@ public class CommandTNT implements CommandExecutor, Listener {
|
||||
}
|
||||
|
||||
private String getEnableMessage() {
|
||||
return "§cTNT-Schaden deaktiviert";
|
||||
return "§aTNT-Schaden aktiviert";
|
||||
}
|
||||
|
||||
private String getDisableMessage() {
|
||||
|
||||
return "§aTNT-Schaden aktiviert";
|
||||
return "§cTNT-Schaden deaktiviert";
|
||||
}
|
||||
|
||||
private String getTestblockEnableMessage() {
|
||||
Lixfel
hat
§cEine Explosion hätte Blöcke im Baubereich zerstört §cEine Explosion hätte Blöcke im Baubereich zerstört
|
||||
@ -93,11 +93,21 @@ public class CommandTNT implements CommandExecutor, Listener {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (args.length != 0 && args[0].equalsIgnoreCase("on")) {
|
||||
if (args.length != 0 && (args[0].equalsIgnoreCase("an") || args[0].equalsIgnoreCase("on"))) {
|
||||
tntMode = TNTMode.ON;
|
||||
sendToActionBar(getEnableMessage());
|
||||
return false;
|
||||
}
|
||||
if (args.length != 0 && (args[0].equalsIgnoreCase("aus") || args[0].equalsIgnoreCase("off"))) {
|
||||
tntMode = TNTMode.OFF;
|
||||
sendToActionBar(getDisableMessage());
|
||||
return false;
|
||||
}
|
||||
if (args.length != 0 && (args[0].equalsIgnoreCase("testblock") || args[0].equalsIgnoreCase("tb"))) {
|
||||
tntMode = TNTMode.ONLY_TB;
|
||||
sendToActionBar(getTestblockEnableMessage());
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (tntMode) {
|
||||
Lixfel
hat
Du registrierst den Command nirgends als Listener (weder implements noch registerEvents(). Du registrierst den Command nirgends als Listener (weder implements noch registerEvents().
|
||||
case ON:
|
||||
|
@ -34,12 +34,17 @@ public class CommandTNTTabComplete implements TabCompleter {
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {
|
||||
if(!(sender instanceof Player)) return new ArrayList<>();
|
||||
return detonaterTabComplete((Player) sender, args);
|
||||
return tntTabComplete((Player) sender, args);
|
||||
}
|
||||
|
||||
private List<String> detonaterTabComplete(Player player, String[] args) {
|
||||
private List<String> tntTabComplete(Player player, String[] args) {
|
||||
List<String> tabComplete = new ArrayList<>();
|
||||
tabComplete.add("an");
|
||||
tabComplete.add("on");
|
||||
tabComplete.add("aus");
|
||||
tabComplete.add("off");
|
||||
tabComplete.add("testblock");
|
||||
tabComplete.add("tb");
|
||||
|
||||
if (args.length >= 2) {
|
||||
return new ArrayList<>();
|
||||
|
@ -284,7 +284,7 @@ public class ScriptListener implements Listener {
|
||||
case "trace":
|
||||
return RecordStateMachine.getRecordStatus().isTracing() ? 1 : 0;
|
||||
case "tnt":
|
||||
return CommandTNT.getInstance().isOn() ? 1 : 0;
|
||||
return CommandTNT.getTntMode() == CommandTNT.TNTMode.OFF ? 0 : 1;
|
||||
case "freeze":
|
||||
return CommandFreeze.getInstance().isOn() ? 1 : 0;
|
||||
case "fire":
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren
am, nicht beim.