New permission nodes to disable any command, factions.disableCommand.<command>, along with factions.disableCommand.none node which forcibly makes none disabled (for * permission users or similar); for <command>, you must use the first command alias given in the /f help information (for example, "show" instead of "who" for that particular command)
This commit is contained in:
@ -340,6 +340,10 @@ public class Factions extends JavaPlugin {
|
||||
return hasPerm(sender, "factions.worldOptions");
|
||||
}
|
||||
|
||||
public static boolean isCommandDisabled(CommandSender sender, String command) {
|
||||
return (hasPerm(sender, "factions.commandDisable."+command) && !hasPerm(sender, "factions.commandDisable.none"));
|
||||
}
|
||||
|
||||
private static boolean hasPerm(CommandSender sender, String permNode) {
|
||||
if (Factions.Permissions == null || ! (sender instanceof Player)) {
|
||||
return sender.isOp() || sender.hasPermission(permNode);
|
||||
|
Reference in New Issue
Block a user