2011-07-18 22:06:02 +02:00
|
|
|
package com.massivecraft.factions.commands;
|
2011-04-06 12:04:57 +02:00
|
|
|
|
2011-10-08 22:03:44 +02:00
|
|
|
import com.massivecraft.factions.P;
|
2011-10-09 14:53:38 +02:00
|
|
|
import com.massivecraft.factions.struct.Permission;
|
2011-04-06 12:04:57 +02:00
|
|
|
|
2011-10-09 14:53:38 +02:00
|
|
|
public class FCommandBypass extends FCommand
|
|
|
|
{
|
|
|
|
public FCommandBypass()
|
|
|
|
{
|
|
|
|
super();
|
|
|
|
this.aliases.add("bypass");
|
2011-04-06 12:04:57 +02:00
|
|
|
|
2011-10-09 14:53:38 +02:00
|
|
|
//this.requiredArgs.add("");
|
|
|
|
this.optionalArgs.put("on/off", "flipp");
|
|
|
|
|
2011-10-09 18:35:39 +02:00
|
|
|
this.permission = Permission.COMMAND_BYPASS.node;
|
2011-10-09 14:53:38 +02:00
|
|
|
|
|
|
|
senderMustBePlayer = true;
|
|
|
|
senderMustBeMember = false;
|
|
|
|
senderMustBeModerator = false;
|
|
|
|
senderMustBeAdmin = false;
|
2011-04-06 12:04:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2011-10-09 14:53:38 +02:00
|
|
|
public void perform()
|
|
|
|
{
|
2011-10-09 18:35:39 +02:00
|
|
|
fme.setIsAdminBypassing(this.argAsBool(0, ! fme.isAdminBypassing()));
|
|
|
|
|
2011-10-09 14:53:38 +02:00
|
|
|
// TODO: Move this to a transient field in the model??
|
2011-10-09 18:35:39 +02:00
|
|
|
if ( fme.isAdminBypassing())
|
2011-10-09 14:53:38 +02:00
|
|
|
{
|
|
|
|
fme.sendMessageParsed("<i>You have enabled admin bypass mode. You will be able to build or destroy anywhere.");
|
|
|
|
P.p.log(fme.getName() + " has ENABLED admin bypass mode.");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
fme.sendMessageParsed("<i>You have disabled admin bypass mode.");
|
|
|
|
P.p.log(fme.getName() + " DISABLED admin bypass mode.");
|
2011-04-06 12:04:57 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|