TntMode #163
@ -34,7 +34,7 @@ public class CommandInfo implements CommandExecutor {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
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 + "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 + "Feuerschaden: " + (CommandFire.getInstance().isOn() ? "§aAUS" : "§cAN"));
|
||||||
sender.sendMessage(BauSystem.PREFIX + "Eingefroren: " + (CommandFreeze.getInstance().isOn() ? "§aJA" : "§cNEIN"));
|
sender.sendMessage(BauSystem.PREFIX + "Eingefroren: " + (CommandFreeze.getInstance().isOn() ? "§aJA" : "§cNEIN"));
|
||||||
|
|
||||||
|
@ -93,20 +93,27 @@ public class CommandTNT implements CommandExecutor, Listener {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.length != 0 && (args[0].equalsIgnoreCase("an") || args[0].equalsIgnoreCase("on"))) {
|
if (args.length != 0) {
|
||||||
tntMode = TNTMode.ON;
|
switch (args[0].toLowerCase()) {
|
||||||
sendToActionBar(getEnableMessage());
|
case "an":
|
||||||
return false;
|
case "on":
|
||||||
}
|
tntMode = TNTMode.ON;
|
||||||
if (args.length != 0 && (args[0].equalsIgnoreCase("aus") || args[0].equalsIgnoreCase("off"))) {
|
sendToActionBar(getEnableMessage());
|
||||||
tntMode = TNTMode.OFF;
|
return false;
|
||||||
sendToActionBar(getDisableMessage());
|
case "aus":
|
||||||
return false;
|
case "off":
|
||||||
}
|
tntMode = TNTMode.OFF;
|
||||||
if (args.length != 0 && Region.buildAreaEnabled() && (args[0].equalsIgnoreCase("testblock") || args[0].equalsIgnoreCase("tb"))) {
|
sendToActionBar(getDisableMessage());
|
||||||
tntMode = TNTMode.ONLY_TB;
|
return false;
|
||||||
sendToActionBar(getTestblockEnableMessage());
|
case "testblock":
|
||||||
return false;
|
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) {
|
switch (tntMode) {
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren
Du registrierst den Command nirgends als Listener (weder implements noch registerEvents().