Factions3/src/com/bukkit/mcteam/factions/commands/FCommandBypass.java
Brettflan 26c708b65e changes AdminBypass permission to enable new "bypass" command which toggles admin bypass mode on or off, defaults to off
added tracking for the SaveTask() and shutdown of it when the plugin is disabled
2011-04-06 05:04:57 -05:00

34 lines
949 B
Java

package com.bukkit.mcteam.factions.commands;
import org.bukkit.command.CommandSender;
import com.bukkit.mcteam.factions.Conf;
import com.bukkit.mcteam.factions.Faction;
import com.bukkit.mcteam.factions.Factions;
import com.bukkit.mcteam.factions.struct.Role;
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.");
}
}
}