Use existing command from plugin.yml if exists
3:33
This commit is contained in:
parent
43b7bd442a
commit
4310e45a6f
1 changed files with 5 additions and 1 deletions
|
@ -204,7 +204,11 @@ public class Command2MC extends Command2<ICommand2MC, Command2MCSender> implemen
|
||||||
var path = command.getCommandPath();
|
var path = command.getCommandPath();
|
||||||
int x = path.indexOf(' ');
|
int x = path.indexOf(' ');
|
||||||
var mainPath = path.substring(0, x == -1 ? path.length() : x);
|
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);
|
cmdmap.register(command.getPlugin().getName(), bukkitCommand);
|
||||||
if (CommodoreProvider.isSupported())
|
if (CommodoreProvider.isSupported())
|
||||||
TabcompleteHelper.registerTabcomplete(command, subcmds, bukkitCommand);
|
TabcompleteHelper.registerTabcomplete(command, subcmds, bukkitCommand);
|
||||||
|
|
Loading…
Reference in a new issue