2011-10-09 21:57:43 +02:00
|
|
|
package com.massivecraft.factions.cmd;
|
2011-04-06 12:04:57 +02:00
|
|
|
|
2019-09-14 21:13:01 +02:00
|
|
|
import com.massivecraft.factions.FactionsPlugin;
|
2011-10-09 14:53:38 +02:00
|
|
|
import com.massivecraft.factions.struct.Permission;
|
2014-12-08 00:12:52 +01:00
|
|
|
import com.massivecraft.factions.zcore.util.TL;
|
2011-04-06 12:04:57 +02:00
|
|
|
|
2014-04-04 20:55:21 +02:00
|
|
|
public class CmdBypass extends FCommand {
|
2014-08-05 17:17:27 +02:00
|
|
|
|
2019-12-02 19:55:38 +01:00
|
|
|
/**
|
|
|
|
* @author FactionsUUID Team
|
|
|
|
*/
|
|
|
|
|
2019-09-15 11:19:06 +02:00
|
|
|
public CmdBypass() {
|
|
|
|
super();
|
|
|
|
this.aliases.add("bypass");
|
|
|
|
|
|
|
|
//this.requiredArgs.add("");
|
|
|
|
this.optionalArgs.put("on/off", "flip");
|
|
|
|
|
|
|
|
this.requirements = new CommandRequirements.Builder(Permission.BYPASS)
|
|
|
|
.playerOnly()
|
|
|
|
.build();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void perform(CommandContext context) {
|
|
|
|
context.fPlayer.setIsAdminBypassing(context.argAsBool(0, !context.fPlayer.isAdminBypassing()));
|
|
|
|
|
|
|
|
// TODO: Move this to a transient field in the model??
|
|
|
|
if (context.fPlayer.isAdminBypassing()) {
|
|
|
|
context.fPlayer.msg(TL.COMMAND_BYPASS_ENABLE.toString());
|
|
|
|
FactionsPlugin.getInstance().log(context.fPlayer.getName() + TL.COMMAND_BYPASS_ENABLELOG.toString());
|
|
|
|
} else {
|
|
|
|
context.fPlayer.msg(TL.COMMAND_BYPASS_DISABLE.toString());
|
|
|
|
FactionsPlugin.getInstance().log(context.fPlayer.getName() + TL.COMMAND_BYPASS_DISABLELOG.toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public TL getUsageTranslation() {
|
|
|
|
return TL.COMMAND_BYPASS_DESCRIPTION;
|
|
|
|
}
|
2019-09-14 21:13:01 +02:00
|
|
|
}
|