Factions3/src/com/massivecraft/factions/cmd/CmdFactionsAdmin.java

37 lines
818 B
Java
Raw Normal View History

2011-10-09 21:57:43 +02:00
package com.massivecraft.factions.cmd;
2013-04-09 13:00:09 +02:00
import com.massivecraft.factions.Factions;
import com.massivecraft.factions.Perm;
2013-04-16 10:11:59 +02:00
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
2013-04-10 13:12:22 +02:00
public class CmdFactionsAdmin extends FCommand
{
2013-04-10 13:12:22 +02:00
public CmdFactionsAdmin()
{
super();
2013-04-16 10:11:59 +02:00
this.addAliases("admin");
2011-10-15 19:46:44 +02:00
this.optionalArgs.put("on/off", "flip");
2013-04-16 10:11:59 +02:00
this.addRequirements(ReqHasPerm.get(Perm.ADMIN.node));
}
@Override
public void perform()
{
fme.setHasAdminMode(this.argAsBool(0, ! fme.hasAdminMode()));
2011-10-09 18:35:39 +02:00
if ( fme.hasAdminMode())
{
fme.msg("<i>You have enabled admin bypass mode.");
Factions.get().log(fme.getName() + " has ENABLED admin bypass mode.");
}
else
{
2011-10-10 13:40:24 +02:00
fme.msg("<i>You have disabled admin bypass mode.");
Factions.get().log(fme.getName() + " DISABLED admin bypass mode.");
}
}
}