Saber-Factions/src/com/massivecraft/factions/commands/FCommandBypass.java

44 lines
1.1 KiB
Java
Raw Normal View History

2011-07-18 22:06:02 +02:00
package com.massivecraft.factions.commands;
2011-07-18 22:06:02 +02:00
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.P;
import com.massivecraft.factions.struct.Permission;
public class FCommandBypass extends FCommand
{
public FCommandBypass()
{
super();
this.aliases.add("bypass");
//this.requiredArgs.add("");
this.optionalArgs.put("on/off", "flipp");
this.permission = Permission.ADMIN_BYPASS.node;
senderMustBePlayer = true;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeAdmin = false;
}
@Override
public void perform()
{
// TODO: Move this to a transient field in the model??
if ( ! Conf.adminBypassPlayers.contains(fme.getName()))
{
Conf.adminBypassPlayers.add(fme.getName());
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
{
Conf.adminBypassPlayers.remove(fme.getName());
fme.sendMessageParsed("<i>You have disabled admin bypass mode.");
P.p.log(fme.getName() + " DISABLED admin bypass mode.");
}
}
}