Class ChatConversationManager

java.lang.Object
tech.guilhermekaua.spigotboot.core.spigot.conversation.ChatConversationManager
All Implemented Interfaces:
org.bukkit.event.Listener, ContextReadyListener

@Internal public class ChatConversationManager extends Object implements org.bukkit.event.Listener, ContextReadyListener
Internal engine behind ChatUtils. Owns the per-player conversation registry, dispatches captured messages, and fires lifecycle hooks. Auto-registered as a Bukkit Listener and a ContextReadyListener by spigot-boot (annotations/handlers added in later tasks).
  • Constructor Details

    • ChatConversationManager

      public ChatConversationManager(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull PlatformScheduler scheduler)
  • Method Details

    • onChat

      public void onChat(@NotNull @NotNull org.bukkit.event.player.AsyncPlayerChatEvent event)
      Captures chat from players in a conversation: cancels the broadcast on the async thread and routes the message to the callback. Players without a conversation are untouched.
      Parameters:
      event - the async chat event
    • onQuit

      public void onQuit(@NotNull @NotNull org.bukkit.event.player.PlayerQuitEvent event)
      Ends a disconnecting player's conversation with EndReason.DISCONNECT.
      Parameters:
      event - the quit event
    • onContextReady

      public void onContextReady(@NotNull @NotNull Context context)
      Installs the ChatUtils facade and registers a shutdown hook that ends every active conversation with EndReason.PLUGIN_DISABLE and uninstalls the facade. The Bukkit event registration is handled separately by BukkitListenerAutoRegistrar.
      Specified by:
      onContextReady in interface ContextReadyListener
      Parameters:
      context - the ready context