2011-07-18 22:06:02 +02:00
|
|
|
package com.massivecraft.factions.commands;
|
2011-04-06 12:04:57 +02:00
|
|
|
|
|
|
|
import org.bukkit.command.CommandSender;
|
2011-07-18 22:06:02 +02:00
|
|
|
|
|
|
|
import com.massivecraft.factions.Conf;
|
2011-10-08 22:03:44 +02:00
|
|
|
import com.massivecraft.factions.P;
|
2011-04-06 12:04:57 +02:00
|
|
|
|
|
|
|
|
2011-10-08 23:22:02 +02:00
|
|
|
public class FCommandBypass extends FCommand {
|
2011-04-06 12:04:57 +02:00
|
|
|
|
|
|
|
public FCommandBypass() {
|
|
|
|
aliases.add("bypass");
|
|
|
|
|
|
|
|
helpDescription = "Enable admin bypass mode; build/destroy anywhere";
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean hasPermission(CommandSender sender) {
|
2011-10-08 22:03:44 +02:00
|
|
|
return P.hasPermAdminBypass(sender);
|
2011-04-06 12:04:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void perform() {
|
2011-10-08 23:22:02 +02:00
|
|
|
if ( ! Conf.adminBypassPlayers.contains(me.getName())) {
|
|
|
|
Conf.adminBypassPlayers.add(me.getName());
|
2011-04-06 12:04:57 +02:00
|
|
|
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.");
|
2011-04-06 12:04:57 +02:00
|
|
|
} else {
|
2011-10-08 23:22:02 +02:00
|
|
|
Conf.adminBypassPlayers.remove(me.getName());
|
2011-04-06 12:04:57 +02:00
|
|
|
me.sendMessage("You have disabled admin bypass mode.");
|
2011-10-08 23:22:02 +02:00
|
|
|
P.log(me.getName() + " DISABLED admin bypass mode.");
|
2011-04-06 12:04:57 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|