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

35 lines
944 B
Java
Raw Normal View History

2011-07-18 22:06:02 +02:00
package com.massivecraft.factions.commands;
import org.bukkit.command.CommandSender;
2011-07-18 22:06:02 +02:00
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.P;
2011-10-08 23:22:02 +02:00
public class FCommandBypass extends FCommand {
public FCommandBypass() {
aliases.add("bypass");
helpDescription = "Enable admin bypass mode; build/destroy anywhere";
}
@Override
public boolean hasPermission(CommandSender sender) {
return P.hasPermAdminBypass(sender);
}
@Override
public void perform() {
2011-10-08 23:22:02 +02:00
if ( ! Conf.adminBypassPlayers.contains(me.getName())) {
Conf.adminBypassPlayers.add(me.getName());
me.sendMessage("You have enabled admin bypass mode. You will be able to build or destroy anywhere.");
2011-10-08 23:22:02 +02:00
P.log(me.getName() + " has ENABLED admin bypass mode.");
} else {
2011-10-08 23:22:02 +02:00
Conf.adminBypassPlayers.remove(me.getName());
me.sendMessage("You have disabled admin bypass mode.");
2011-10-08 23:22:02 +02:00
P.log(me.getName() + " DISABLED admin bypass mode.");
}
}
}