Use existing command from plugin.yml if exists

3:33
This commit is contained in:
Norbi Peti 2020-08-27 03:33:46 +02:00
parent 43b7bd442a
commit 4310e45a6f
No known key found for this signature in database
GPG key ID: DBA4C4549A927E56

View file

@ -204,7 +204,11 @@ public class Command2MC extends Command2<ICommand2MC, Command2MCSender> implemen
var path = command.getCommandPath();
int x = path.indexOf(' ');
var mainPath = path.substring(0, x == -1 ? path.length() : x);
var bukkitCommand = new BukkitCommand(mainPath);
Command bukkitCommand;
{
var oldcmd = cmdmap.getCommand(mainPath);
bukkitCommand = oldcmd == null ? new BukkitCommand(mainPath) : oldcmd;
}
cmdmap.register(command.getPlugin().getName(), bukkitCommand);
if (CommodoreProvider.isSupported())
TabcompleteHelper.registerTabcomplete(command, subcmds, bukkitCommand);