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 {
|
|
|
|
|
2019-03-03 04:51:21 +01:00
|
|
|
public CmdSB() {
|
|
|
|
this.aliases.add("sb");
|
|
|
|
this.aliases.add("scoreboard");
|
|
|
|
this.permission = Permission.SCOREBOARD.node;
|
|
|
|
this.senderMustBePlayer = true;
|
|
|
|
}
|
2014-08-05 17:17:27 +02:00
|
|
|
|
2019-03-03 04:51:21 +01:00
|
|
|
@Override
|
|
|
|
public void perform() {
|
|
|
|
boolean toggleTo = !fme.showScoreboard();
|
|
|
|
FScoreboard board = FScoreboard.get(fme);
|
|
|
|
if (board == null) {
|
|
|
|
me.sendMessage(TL.COMMAND_TOGGLESB_DISABLED.toString());
|
|
|
|
} else {
|
|
|
|
me.sendMessage(TL.TOGGLE_SB.toString().replace("{value}", String.valueOf(toggleTo)));
|
|
|
|
board.setSidebarVisibility(toggleTo);
|
|
|
|
}
|
|
|
|
fme.setShowScoreboard(toggleTo);
|
|
|
|
}
|
2015-01-22 00:58:33 +01:00
|
|
|
|
2019-03-03 04:51:21 +01:00
|
|
|
@Override
|
|
|
|
public TL getUsageTranslation() {
|
|
|
|
return TL.COMMAND_SCOREBOARD_DESCRIPTION;
|
|
|
|
}
|
2014-08-05 17:17:27 +02:00
|
|
|
}
|