ACF's permission tree can go more complex where a single root command
may have multiple dependent perm nodes.
So essentially ACF does not assign permission nodes to root in bukkit
and the such in a reasonable manner.
With this commit, we try to identify a single unique permission node,
and assign that permission node as the node to use where applicable.
In Bukkit/Sponge, we implement testPermission instead, which does a smarter
look up of all potential commands that root command might execute for the
given issuer, and if they have permission to any of them, then pass as true.
This is much more accurate, so if the issuer has access to no subcommand
then the root command should not be revealed anymore in Bukkit or Sponge.
In bungee, we are best guess at the unique perm node, and if there is
any ambiguity, it will be null and seen by everyone (but still enforces
permission checks)
This PR is to allow users to unregister commands from the `JDACommandManager`
Currently slightly flawed, needs research. When re-registering it spits out a load of messages like so:
```
SEVERE: [ACF] ACF Error: settings registered subcommand boss role for root command settings - but it is already defined in settings
Sep 20, 2018 3:58:31 AM com.algorithmjunkie.freelance.gachapon.acf.JDACommandManager log
SEVERE: [ACF] 2 subcommands of the same prefix may not be spread over 2 different classes. Ignoring this.
```
Not sure if this is just for me, or if it's for all.
The code is now checking for placeholders, that are not replaced. This would also warn the dev if he completely forgets to register a replacement.
The downside of this is, that any %.* kind of pattern, that is NOT supposed to be a replacement will cause an error message. But since I couldn't come up for a reason to include % in any of the Annotation values other than a replacement, I decided this is much easier than checking all "old" commands when a replacement is registered.
Alternatively, I could collect all these unreplaced replacements and check against the collection when a new one is registered. This would not warn a dev that forgot to register the replacement, but on the other hand still allows the use of %. Please tell me what you think.
resolves#160
You must pass your own exception handler in order to do this.
Implementors need to be sure to log if its not a desired throw or
otherwise you will have silent command failures.
Improve help output for commands split over multiple base commands
Fix help last page detection
Fix missing argument on Player Context Resolve
Expose registered root commands