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

39 lines
1.1 KiB
Java
Raw Normal View History

2011-10-09 21:57:43 +02:00
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.P;
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 {
2014-04-04 20:55:21 +02:00
public CmdBypass() {
2014-07-01 22:10:18 +02:00
super();
this.aliases.add("bypass");
2014-04-04 20:55:21 +02:00
//this.requiredArgs.add("");
this.optionalArgs.put("on/off", "flip");
2014-07-01 22:10:18 +02:00
this.permission = Permission.BYPASS.node;
this.disableOnLock = false;
2014-04-04 20:55:21 +02:00
2014-07-01 22:10:18 +02:00
senderMustBePlayer = true;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeAdmin = false;
2014-04-04 20:55:21 +02:00
}
@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());
P.p.log(fme.getName() + TL.COMMAND_BYPASS_ENABLELOG.toString());
2014-07-01 21:52:40 +02:00
} else {
fme.msg(TL.COMMAND_BYPASS_DISABLE.toString());
P.p.log(fme.getName() + TL.COMMAND_BYPASS_DISABLELOG.toString());
2014-04-04 20:55:21 +02:00
}
}
}