use of org.spongepowered.common.command.brigadier.dispatcher.DelegatingCommandDispatcher in project SpongeCommon by SpongePowered.
the class CommandsMixin method impl$useSpongeDispatcher.
// We prepare our own dispatcher and commands manager, to redirect registrations to our system
@Redirect(method = "<init>", at = @At(value = "NEW", args = "class=com/mojang/brigadier/CommandDispatcher", remap = false))
private CommandDispatcher<CommandSourceStack> impl$useSpongeDispatcher() {
final SpongeCommandManager manager = Launch.instance().lifecycle().platformInjector().getInstance(SpongeCommandManager.class);
manager.init();
this.impl$commandManager = manager;
return new DelegatingCommandDispatcher(manager.getBrigadierRegistrar());
}
Aggregations