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.getTntMode() == CommandTNT.TNTMode.OFF ? "§cAN" : "§aAUS"));
|
||||
sender.sendMessage(BauSystem.PREFIX + "TNT-Schaden: " + CommandTNT.getTntMode().getName());
|
||||
sender.sendMessage(BauSystem.PREFIX + "Feuerschaden: " + (CommandFire.getInstance().isOn() ? "§aAUS" : "§cAN"));
|
||||
sender.sendMessage(BauSystem.PREFIX + "Eingefroren: " + (CommandFreeze.getInstance().isOn() ? "§aJA" : "§cNEIN"));
|
||||
|
||||
|
@ -93,20 +93,27 @@ public class CommandTNT implements CommandExecutor, Listener {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (args.length != 0 && (args[0].equalsIgnoreCase("an") || args[0].equalsIgnoreCase("on"))) {
|
||||
if (args.length != 0) {
|
||||
switch (args[0].toLowerCase()) {
|
||||
case "an":
|
||||
case "on":
|
||||
tntMode = TNTMode.ON;
|
||||
sendToActionBar(getEnableMessage());
|
||||
return false;
|
||||
}
|
||||
if (args.length != 0 && (args[0].equalsIgnoreCase("aus") || args[0].equalsIgnoreCase("off"))) {
|
||||
case "aus":
|
||||
case "off":
|
||||
tntMode = TNTMode.OFF;
|
||||
sendToActionBar(getDisableMessage());
|
||||
return false;
|
||||
}
|
||||
if (args.length != 0 && Region.buildAreaEnabled() && (args[0].equalsIgnoreCase("testblock") || args[0].equalsIgnoreCase("tb"))) {
|
||||
case "testblock":
|
||||
case "tb":
|
||||
if (!Region.buildAreaEnabled()) break;
|
||||
tntMode = TNTMode.ONLY_TB;
|
||||
sendToActionBar(getTestblockEnableMessage());
|
||||
|
||||
return false;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
Lixfel
hat
Ich denke, ein switch-case würde sich besser lesen lassen als dieses If if else gedöns. Ich denke, ein switch-case würde sich besser lesen lassen als dieses If if else gedöns.
|
||||
}
|
||||
|
||||
switch (tntMode) {
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren
Du registrierst den Command nirgends als Listener (weder implements noch registerEvents().