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;
|
|
|
|
import com.massivecraft.factions.Factions;
|
2011-04-06 12:04:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
public class FCommandBypass extends FBaseCommand {
|
|
|
|
|
|
|
|
public FCommandBypass() {
|
|
|
|
aliases.add("bypass");
|
|
|
|
|
|
|
|
helpDescription = "Enable admin bypass mode; build/destroy anywhere";
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean hasPermission(CommandSender sender) {
|
|
|
|
return Factions.hasPermAdminBypass(sender);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void perform() {
|
|
|
|
if ( ! Conf.adminBypassPlayers.contains(player.getName())) {
|
|
|
|
Conf.adminBypassPlayers.add(player.getName());
|
|
|
|
me.sendMessage("You have enabled admin bypass mode. You will be able to build or destroy anywhere.");
|
|
|
|
} else {
|
|
|
|
Conf.adminBypassPlayers.remove(player.getName());
|
|
|
|
me.sendMessage("You have disabled admin bypass mode.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|