Class VGuiBootstrap

java.lang.Object
me.agent.vgui.core.VGuiBootstrap

public final class VGuiBootstrap extends Object
Wires VGui into a running proxy. Used two ways:

A shaded integration can share PacketEvents when it deliberately uses the same API classes and class loader. The standalone release embeds the runtime it manages.

  • Method Details

    • instance

      public static VGuiBootstrap instance()
      The active bootstrap, or null before init(ProxyServer, Object, Logger, boolean).
    • loadPacketEvents

      public static boolean loadPacketEvents(com.velocitypowered.api.proxy.ProxyServer server, com.velocitypowered.api.plugin.PluginContainer container, org.slf4j.Logger logger, Path dataDirectory)
      Builds and loads the PacketEvents API if no other plugin has installed it yet. Call from your plugin constructor (before the proxy initializes). Safe to call when PacketEvents is already present.
      Returns:
      true if this call installed PacketEvents (VGui then owns its lifecycle and will terminate it on shutdown)
    • init

      public static VGuiBootstrap init(com.velocitypowered.api.proxy.ProxyServer server, Object pluginInstance, org.slf4j.Logger logger, boolean managePacketEvents)
      Initializes VGui: PacketEvents listeners, session manager, disconnect cleanup and the VGui service singleton. Call once from ProxyInitializeEvent.
      Parameters:
      server - the proxy
      pluginInstance - your plugin main-class instance (used to register Velocity events and scheduler tasks)
      logger - logger for VGui diagnostics
      managePacketEvents - whether VGui owns the PacketEvents lifecycle (pass the result of loadPacketEvents(ProxyServer, PluginContainer, Logger, Path))
    • sessionManager

      public SessionManager sessionManager()
      The session manager (internal API, exposed for the platform plugin).
    • shutdown

      public void shutdown()
      Closes all views and (if VGui owns it) terminates PacketEvents.