Both of the commands setup within my plugin are not running when run by the user, they are defined both within the plugin.yml (below) and are set in the onEnable() (below) method in the main class.
I have investigated this with both logging and through a debugger with jdwp, the onCommand method is never reached.
It seems like we reach the following line in execute in the Spigot PluginCommand class:
success = executor.onCommand(sender, this, commandLabel, args);
This sends us into getCommand in the JavaPlugin class (I assume some sort of reflection being done here in the background) where we do the following if statement:
if (command == null || command.getPlugin() != this)
I then take the next step in the debugger and we end up back in execute in PluginCommand with a success value of false
Both logical operators in this if statement result in false so we should continue to the next if statement (below) and return command as expected. Any idea why this is not happening would be massively appriciated - I am totally stumped
if (command != null && command.getPlugin() == this)