2014-08-05 17:17:27 +02:00
|
|
|
package com.massivecraft.factions.cmd;
|
|
|
|
|
2014-10-16 03:58:37 +02:00
|
|
|
import com.massivecraft.factions.scoreboards.FScoreboard;
|
2014-08-05 17:17:27 +02:00
|
|
|
import com.massivecraft.factions.struct.Permission;
|
|
|
|
import com.massivecraft.factions.zcore.util.TL;
|
|
|
|
|
|
|
|
public class CmdSB extends FCommand {
|
|
|
|
|
|
|
|
public CmdSB() {
|
|
|
|
this.aliases.add("sb");
|
|
|
|
this.permission = Permission.SCOREBOARD.node;
|
|
|
|
this.senderMustBePlayer = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void perform() {
|
2015-05-18 21:32:12 +02:00
|
|
|
boolean toggleTo = !fme.showScoreboard();
|
2015-03-10 05:44:34 +01:00
|
|
|
FScoreboard board = FScoreboard.get(fme);
|
2015-05-13 06:17:22 +02:00
|
|
|
if (board == null) {
|
2015-03-10 05:44:34 +01:00
|
|
|
me.sendMessage(TL.COMMAND_TOGGLESB_DISABLED.toString());
|
|
|
|
} else {
|
2015-05-18 21:32:12 +02:00
|
|
|
me.sendMessage(TL.TOGGLE_SB.toString().replace("{value}", String.valueOf(toggleTo)));
|
|
|
|
board.setSidebarVisibility(toggleTo);
|
2014-08-05 17:17:27 +02:00
|
|
|
}
|
2015-05-18 21:32:12 +02:00
|
|
|
fme.setShowScoreboard(toggleTo);
|
2014-08-05 17:17:27 +02:00
|
|
|
}
|
2015-01-22 00:58:33 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public TL getUsageTranslation() {
|
|
|
|
return TL.COMMAND_SCOREBOARD_DESCRIPTION;
|
|
|
|
}
|
2014-08-05 17:17:27 +02:00
|
|
|
}
|