2011-10-09 21:57:43 +02:00
|
|
|
package com.massivecraft.factions.cmd;
|
2011-04-06 12:04:57 +02:00
|
|
|
|
2018-10-23 01:42:57 +02:00
|
|
|
import com.massivecraft.factions.SavageFactions;
|
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
|
|
|
|
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;
|
2018-03-26 23:43:15 +02:00
|
|
|
senderMustBeColeader = false;
|
2014-07-01 22:10:18 +02:00
|
|
|
senderMustBeAdmin = false;
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void perform() {
|
2018-11-07 17:14:42 +01:00
|
|
|
fme.setIsAdminBypassing(this.argAsBool(0, !fme.isAdminBypassing()));
|
2014-04-04 20:55:21 +02:00
|
|
|
|
|
|
|
// TODO: Move this to a transient field in the model??
|
|
|
|
if (fme.isAdminBypassing()) {
|
2014-12-08 00:12:52 +01:00
|
|
|
fme.msg(TL.COMMAND_BYPASS_ENABLE.toString());
|
2018-11-07 06:38:43 +01:00
|
|
|
SavageFactions.plugin.log(fme.getName() + TL.COMMAND_BYPASS_ENABLELOG.toString());
|
2014-07-01 21:52:40 +02:00
|
|
|
} else {
|
2014-12-08 00:12:52 +01:00
|
|
|
fme.msg(TL.COMMAND_BYPASS_DISABLE.toString());
|
2018-11-07 06:38:43 +01:00
|
|
|
SavageFactions.plugin.log(fme.getName() + TL.COMMAND_BYPASS_DISABLELOG.toString());
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
}
|
2015-01-22 00:58:33 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public TL getUsageTranslation() {
|
|
|
|
return TL.COMMAND_BYPASS_DESCRIPTION;
|
|
|
|
}
|
2011-04-06 12:04:57 +02:00
|
|
|
}
|