✨ Also expose the Brigadier manager from the VelocityCommandManager
This commit is contained in:
parent
d484b99fc4
commit
118005978f
4 changed files with 25 additions and 1 deletions
|
|
@ -25,6 +25,8 @@ package cloud.commandframework.velocity;
|
|||
|
||||
import cloud.commandframework.CommandManager;
|
||||
import cloud.commandframework.CommandTree;
|
||||
import cloud.commandframework.brigadier.BrigadierManagerHolder;
|
||||
import cloud.commandframework.brigadier.CloudBrigadierManager;
|
||||
import cloud.commandframework.captions.FactoryDelegatingCaptionRegistry;
|
||||
import cloud.commandframework.execution.CommandExecutionCoordinator;
|
||||
import cloud.commandframework.meta.CommandMeta;
|
||||
|
|
@ -52,7 +54,7 @@ import java.util.function.Function;
|
|||
* @param <C> Command sender type
|
||||
*/
|
||||
@Singleton
|
||||
public class VelocityCommandManager<C> extends CommandManager<C> {
|
||||
public class VelocityCommandManager<C> extends CommandManager<C> implements BrigadierManagerHolder<C> {
|
||||
|
||||
/**
|
||||
* Default caption for {@link VelocityCaptionKeys#ARGUMENT_PARSE_FAILURE_PLAYER}
|
||||
|
|
@ -124,6 +126,20 @@ public class VelocityCommandManager<C> extends CommandManager<C> {
|
|||
return SimpleCommandMeta.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* <p>
|
||||
* In the case of the {@link VelocityCommandManager}, Brigadier is always used for command registration,
|
||||
* and therefore this method will never return {@code null}.
|
||||
*
|
||||
* @since 1.2.0
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public @NonNull CloudBrigadierManager<C, CommandSource> brigadierManager() {
|
||||
return ((VelocityPluginRegistrationHandler<C>) this.getCommandRegistrationHandler()).brigadierManager();
|
||||
}
|
||||
|
||||
final @NonNull ProxyServer getProxyServer() {
|
||||
return this.proxyServer;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,4 +79,8 @@ final class VelocityPluginRegistrationHandler<C> implements CommandRegistrationH
|
|||
return true;
|
||||
}
|
||||
|
||||
@NonNull CloudBrigadierManager<C, CommandSource> brigadierManager() {
|
||||
return this.brigadierManager;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue