2019-11-29 02:34:39 +01:00
|
|
|
package com.massivecraft.factions.cmd;
|
|
|
|
|
|
|
|
import com.massivecraft.factions.FactionsPlugin;
|
|
|
|
import com.massivecraft.factions.struct.Permission;
|
|
|
|
import com.massivecraft.factions.zcore.util.TL;
|
|
|
|
|
|
|
|
public class CmdPlayerTitleToggle extends FCommand {
|
|
|
|
public CmdPlayerTitleToggle() {
|
|
|
|
super();
|
2020-01-02 02:59:31 +01:00
|
|
|
this.aliases.addAll(Aliases.titles);
|
2019-11-29 02:34:39 +01:00
|
|
|
this.requirements = new CommandRequirements.Builder(Permission.TOGGLE_TITLES)
|
|
|
|
.build();
|
|
|
|
}
|
|
|
|
@Override
|
|
|
|
public void perform(CommandContext context) {
|
|
|
|
context.fPlayer.setTitlesEnabled(!context.fPlayer.hasTitlesEnabled());
|
|
|
|
context.msg(TL.COMMAND_TITLETOGGLE_TOGGLED, context.fPlayer.hasTitlesEnabled() ? FactionsPlugin.getInstance().color("&dEnabled") : FactionsPlugin.getInstance().color("&dDisabled"));
|
|
|
|
}
|
|
|
|
@Override
|
|
|
|
public TL getUsageTranslation() {return TL.COMMAND_TITLETOGGLE_DESCRIPTION;}
|
|
|
|
}
|