So figured this one out on my own. The issue was not that the plugin.yml was set to false, infact you want to keep it that way so that users by defualt do not have access to the command. My problem was that i left the Permission-Node under the command block in the plugin.yml. I was attempting to utilize the native Bukkit api (command block permisions) and the Updated Bukkit api (permissions block permissions). the Command Block permissions were taking precedence and overwriting any code i had in place. By removing:
permission: ConsoleFilter.Reload
permission-message: You don't have ConsoleFilter Permissions node- ConsoleFilter.Reload
from the plugin.yml I allowed my code to do its work.
Also a few code changes may have contributed to the end result:
//Overrides bukkits onCommand with modified code
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (args.length > 1) {//No more then 1 argument
sender.sendMessage("[ConsoleFilter] Too many arguments!"); //Sends player a message
return false;
}
if (args.length < 1) {//No less then 1 argument
sender.sendMessage("[ConsoleFilter] Not enough arguments!"); //Sends player a message
return false;
}
//plugin.yml will actually validate permissions, however additional provisions allows for
//further security and further extendability.
if (sender instanceof Player){ //if sender is a player entity
Player player = (Player) sender; //Sets player to sender
if (player.isOp() || player.hasPermission("ConsoleFilter.Reload")){//Is the player an Op or have specified Permission
if (cmd.getName().equalsIgnoreCase("CF")) { //Checks for /CF
if (args[0].equalsIgnoreCase("Reload")){ //Checks for /CF Reload
this.reloadConfig(); //Reloads config file back into memory
player.sendMessage(ChatColor.DARK_GREEN + "Config Reloaded!"); //Sends player a message
getLogger().info("[ConsoleFilter] Config Reloaded");
return true; //Close True
}
}
}else{
player.sendMessage("You do not have the appropriate Permissions. (ConsoleFilter.Reload)");;
}
}else{
this.reloadConfig(); //Reloads config file back into memory
getLogger().info("[ConsoleFilter] Config Reloaded");
return true; //Close True
}
return false;
}