-
-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Main command permission is null if i set a permission on a subcommand #375
Comments
Im not able to set a permission for the maincommand itself. Why? |
The fundamental issue is that you are trying to use the Bukkit api to get information about the ACF command system. Perhaps you could try |
I must use the BukkitAPI, because i want filter non acf Commands too. And the RootCommand do not provide me any method to get his "RootCommandPermission" because is it not even possible to set one. ACF allows executing a rootcommands subcommand, if you have a subcommands permission. That is the reason why acf dont gives the root a permission if a subcommand has a permission . If the rootcmd had a permission set, executing a subcommand would require to have the rootcommand-permission as well. Beacuse of that, an extra @RootCommandPermission annotation would be very nice. |
The big issue here: @CommandPermission("root.one")
@CommandAlias("bla")
public class OneCommand extends BaseCommand { ... }
@CommandPermission("root.two")
@CommandAlias("bla")
public class TwoCommand extends BaseCommand { ... } Both classes have the same root command but different command permissions. You can use Adding a getter or overloading the getter in BukkitCommandManager could be helpful here. I don't see a better solution for that. |
Hello, i have this command here!
`@CommandAlias("hide")
@CommandPermission("core.command.hide")
public class HideCommand extends BaseCommand {
}`
I use this code to get the permission of a command
Command command = plugin.getServer().getCommandMap().getCommand("ignore");
Now if i call command.getPermission() it return null, but it must return "core.command.hide"
On all other commands i have made it works well
The error occurs, if i add a subcommand with a permission!
To Test:
Make a normal command without SubCommands (a @default method) and a permission set
Use this code on Paper:
Command command = plugin.getServer().getCommandMap().getCommand("nameofthecommand");
Call command.getPermission() you will see the permission
Now add a subcommand with @subcommand("test") and @CommandPermission("test.test");
Call command.getPermission() another time, and you will see that it returns null
It would be nice if this gets fixed because it destroys my system!
Thanks
The text was updated successfully, but these errors were encountered: