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 Summary
ConstructorsConstructorDescriptionChatConversationManager(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull PlatformScheduler scheduler) -
Method Summary
Modifier and TypeMethodDescriptionvoidonChat(@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.voidonContextReady(@NotNull Context context) Installs theChatUtilsfacade and registers a shutdown hook that ends every active conversation withEndReason.PLUGIN_DISABLEand uninstalls the facade.voidonQuit(@NotNull org.bukkit.event.player.PlayerQuitEvent event) Ends a disconnecting player's conversation withEndReason.DISCONNECT.
-
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 withEndReason.DISCONNECT.- Parameters:
event- the quit event
-
onContextReady
Installs theChatUtilsfacade and registers a shutdown hook that ends every active conversation withEndReason.PLUGIN_DISABLEand uninstalls the facade. The Bukkit event registration is handled separately byBukkitListenerAutoRegistrar.- Specified by:
onContextReadyin interfaceContextReadyListener- Parameters:
context- the ready context
-