Saber-Factions/src/main/java/com/massivecraft/factions/cmd/CmdBypass.java

45 lines
1.2 KiB
Java
Raw Normal View History

2011-10-09 21:57:43 +02:00
package com.massivecraft.factions.cmd;
2019-06-29 03:49:46 +02:00
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
2014-04-04 20:55:21 +02:00
public class CmdBypass extends FCommand {
public CmdBypass() {
super();
this.aliases.add("bypass");
//this.requiredArgs.add("");
this.optionalArgs.put("on/off", "flip");
this.permission = Permission.BYPASS.node;
this.disableOnLock = false;
senderMustBePlayer = true;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}
@Override
public void perform() {
fme.setIsAdminBypassing(this.argAsBool(0, !fme.isAdminBypassing()));
// TODO: Move this to a transient field in the model??
if (fme.isAdminBypassing()) {
fme.msg(TL.COMMAND_BYPASS_ENABLE.toString());
2019-06-29 03:49:46 +02:00
SaberFactions.plugin.log(fme.getName() + TL.COMMAND_BYPASS_ENABLELOG.toString());
} else {
fme.msg(TL.COMMAND_BYPASS_DISABLE.toString());
2019-06-29 03:49:46 +02:00
SaberFactions.plugin.log(fme.getName() + TL.COMMAND_BYPASS_DISABLELOG.toString());
}
}
@Override
public TL getUsageTranslation() {
return TL.COMMAND_BYPASS_DESCRIPTION;
}
}