lucko/commodore

{bug} Commodore sends namespaced commands despite it being removed from the command list

Opened this issue · 1 comments

Hello!

I have discovered a minor bug with commodore that would be nice to have fixed.

With normal Spigot commands, namespaced commands (ones that are like "pixelpatriots:tpa") can be removed by changing the "send-namespaced" to false in the spigot.yml file or by listening to PlayerCommandSendEvent and removing it from the command list.

With Commodore, however, despite having both these options enabled (spigot.yml send-namespaced set to false and removing the command from PlayerCommandSendEvent), the command is still in the command list.

Here are a few screenshots:
image
image
image

And yes, I have tried relogging and restarting the server. Neither have worked.

I also may have found the code responsible

if (command instanceof PluginCommand) {
String fallbackPrefix = ((PluginCommand) command).getPlugin().getName().toLowerCase().trim();
aliasesStream = aliasesStream.flatMap(alias -> Stream.of(
alias,
fallbackPrefix + ":" + alias
));

(though I'm not sure, as I don't 100% understand how it works)


June 2023 Edit

I also feel I should mention that this is not the case with normal Spigot/Paper commands. I can safely remove their namespaced versions without any trouble using both the options I mentioned above (i.e., spigot config file and PlayerCommandSendEvent).

same issue here it is extremely annoying