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>

public final class VelocityImperat<P> extends studio.mevera.imperat.BaseImperat<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 Type
    Method
    Description
    static <P> VelocityConfigBuilder<P>
    builder(P plugin, @NotNull com.velocitypowered.api.proxy.ProxyServer proxyServer)
    Creates a new configuration builder for VelocityImperat.
    com.velocitypowered.api.proxy.ProxyServer
     
     
    void
    registerCommand(studio.mevera.imperat.command.Command<VelocitySource> command)
     
    void
     
    void
     
     

    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, unregisterAllCommands

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface studio.mevera.imperat.AnnotationInjector

    registerThrowableHandler

    Methods 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 instance
      proxyServer - the Velocity ProxyServer instance
      Returns:
      a new VelocityConfigBuilder for further configuration
    • registerCommand

      public void registerCommand(studio.mevera.imperat.command.Command<VelocitySource> command)
      Specified by:
      registerCommand in interface studio.mevera.imperat.CommandRegistrar<P>
      Overrides:
      registerCommand in class studio.mevera.imperat.BaseImperat<VelocitySource>
    • unregisterCommand

      public void unregisterCommand(String name)
      Specified by:
      unregisterCommand in interface studio.mevera.imperat.CommandRegistrar<P>
      Overrides:
      unregisterCommand in class studio.mevera.imperat.BaseImperat<VelocitySource>
    • getPlatform

      public com.velocitypowered.api.proxy.ProxyServer getPlatform()
    • getPlugin

      @NotNull public P getPlugin()
    • shutdownPlatform

      public void shutdownPlatform()
    • wrapSender

      public VelocitySource wrapSender(Object sender)