Command should also register in place of vanilla (e.g. /list)
This commit is contained in:
parent
ac52e024f3
commit
307b5132df
@ -145,6 +145,11 @@ public abstract class PaperBrigadierCommand extends BrigadierCommand<CommandSour
|
|||||||
vanillaPaperDispatcher = event.registrar().getDispatcher();
|
vanillaPaperDispatcher = event.registrar().getDispatcher();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (vanillaPaperDispatcher.getRoot().getChild(commandNode.getName()) != null) {
|
||||||
|
Log.info("There is already a /" + commandNode.getName() + " in the vanilla dispatcher. Is it a vanilla command? Replacing it anyway.");
|
||||||
|
vanillaPaperDispatcher.getRoot().getChildren().removeIf(c -> c.getName().equals(commandNode.getName()));
|
||||||
|
}
|
||||||
|
|
||||||
registeredAliases = new HashSet<>(event.registrar().register(commandNode, description, List.of(aliases)));
|
registeredAliases = new HashSet<>(event.registrar().register(commandNode, description, List.of(aliases)));
|
||||||
|
|
||||||
if (registrationPolicy == RegistrationPolicy.ALL) {
|
if (registrationPolicy == RegistrationPolicy.ALL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user