✨ 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
|
|
@ -323,6 +323,8 @@ public class BukkitCommandManager<C> extends CommandManager<C> implements Brigad
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
*
|
||||||
|
* @since 1.2.0
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public @Nullable CloudBrigadierManager<C, ?> brigadierManager() {
|
public @Nullable CloudBrigadierManager<C, ?> brigadierManager() {
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,8 @@ public class PaperCommandManager<C> extends BukkitCommandManager<C> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
*
|
||||||
|
* @since 1.2.0
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public @Nullable CloudBrigadierManager<C, ?> brigadierManager() {
|
public @Nullable CloudBrigadierManager<C, ?> brigadierManager() {
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@ package cloud.commandframework.velocity;
|
||||||
|
|
||||||
import cloud.commandframework.CommandManager;
|
import cloud.commandframework.CommandManager;
|
||||||
import cloud.commandframework.CommandTree;
|
import cloud.commandframework.CommandTree;
|
||||||
|
import cloud.commandframework.brigadier.BrigadierManagerHolder;
|
||||||
|
import cloud.commandframework.brigadier.CloudBrigadierManager;
|
||||||
import cloud.commandframework.captions.FactoryDelegatingCaptionRegistry;
|
import cloud.commandframework.captions.FactoryDelegatingCaptionRegistry;
|
||||||
import cloud.commandframework.execution.CommandExecutionCoordinator;
|
import cloud.commandframework.execution.CommandExecutionCoordinator;
|
||||||
import cloud.commandframework.meta.CommandMeta;
|
import cloud.commandframework.meta.CommandMeta;
|
||||||
|
|
@ -52,7 +54,7 @@ import java.util.function.Function;
|
||||||
* @param <C> Command sender type
|
* @param <C> Command sender type
|
||||||
*/
|
*/
|
||||||
@Singleton
|
@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}
|
* Default caption for {@link VelocityCaptionKeys#ARGUMENT_PARSE_FAILURE_PLAYER}
|
||||||
|
|
@ -124,6 +126,20 @@ public class VelocityCommandManager<C> extends CommandManager<C> {
|
||||||
return SimpleCommandMeta.empty();
|
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() {
|
final @NonNull ProxyServer getProxyServer() {
|
||||||
return this.proxyServer;
|
return this.proxyServer;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -79,4 +79,8 @@ final class VelocityPluginRegistrationHandler<C> implements CommandRegistrationH
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull CloudBrigadierManager<C, CommandSource> brigadierManager() {
|
||||||
|
return this.brigadierManager;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue