Package studio.mevera.imperat
Class VelocityImperat<P>
java.lang.Object
studio.mevera.imperat.BaseImperat<VelocitySource>
studio.mevera.imperat.VelocityImperat<P>
- Type Parameters:
P- the plugin class type that owns this Imperat instance
- All Implemented Interfaces:
studio.mevera.imperat.AnnotationInjector<VelocitySource>,studio.mevera.imperat.CommandRegistrar<VelocitySource>,studio.mevera.imperat.Imperat<VelocitySource>,studio.mevera.imperat.SourceWrapper<VelocitySource>
Main Imperat implementation for Velocity proxy servers.
This class serves as the primary entry point for integrating the Imperat command framework
with Velocity proxy servers. It provides command registration, execution, and management
specifically tailored for Velocity's architecture.
Key Features:
- Seamless integration with Velocity's command system
- Automatic command registration and unregistration
- Built-in parameter types for Velocity objects (Players, ServerInfo, etc.)
- Exception handling for Velocity-specific scenarios
- Support for both synchronous and asynchronous command execution
Usage Example:
public class MyPlugin {
private VelocityImperat<MyPlugin> imperat;
@Subscribe
public void onProxyInitialization(ProxyInitializeEvent event) {
imperat = VelocityImperat.builder(this, proxyServer)
.build();
imperat.registerCommand(MyCommand.class);
}
}
- Since:
- 1.0
- See Also:
-
Field Summary
Fields inherited from class studio.mevera.imperat.BaseImperat
config -
Method Summary
Modifier and TypeMethodDescriptionstatic <P> VelocityConfigBuilder<P> builder(P plugin, @NotNull com.velocitypowered.api.proxy.ProxyServer proxyServer) Creates a new configuration builder for VelocityImperat.com.velocitypowered.api.proxy.ProxyServervoidregisterCommand(studio.mevera.imperat.command.Command<VelocitySource> command) voidvoidunregisterCommand(String name) wrapSender(Object sender) Methods inherited from class studio.mevera.imperat.BaseImperat
autoComplete, canBeSender, config, debug, execute, execute, execute, execute, execute, executeUsage, getAnnotationParser, getCommand, getRegisteredCommands, getSubCommand, registerAnnotationReplacer, registerAnnotations, registerCommand, registerCommand, setAnnotationParser, unregisterAllCommandsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface studio.mevera.imperat.AnnotationInjector
registerThrowableHandlerMethods inherited from interface studio.mevera.imperat.CommandRegistrar
getCommand, registerCommands, registerCommands, registerCommands
-
Method Details
-
builder
public static <P> VelocityConfigBuilder<P> builder(@NotNull P plugin, @NotNull @NotNull com.velocitypowered.api.proxy.ProxyServer proxyServer) Creates a new configuration builder for VelocityImperat. This is the recommended way to create and configure a VelocityImperat instance.- Type Parameters:
P- the plugin class type- Parameters:
plugin- the plugin instance that will own this Imperat instanceproxyServer- the Velocity ProxyServer instance- Returns:
- a new VelocityConfigBuilder for further configuration
-
registerCommand
- Specified by:
registerCommandin interfacestudio.mevera.imperat.CommandRegistrar<P>- Overrides:
registerCommandin classstudio.mevera.imperat.BaseImperat<VelocitySource>
-
unregisterCommand
- Specified by:
unregisterCommandin interfacestudio.mevera.imperat.CommandRegistrar<P>- Overrides:
unregisterCommandin classstudio.mevera.imperat.BaseImperat<VelocitySource>
-
getPlatform
public com.velocitypowered.api.proxy.ProxyServer getPlatform() -
getPlugin
-
shutdownPlatform
public void shutdownPlatform() -
wrapSender
-