Class ConversationContext

java.lang.Object
org.bukkit.conversations.ConversationContext

@Deprecated(forRemoval=true) public class ConversationContext extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
The conversation API has been deprecated for removal. This system does not support component based messages and has been slowly losing functionality over the years as Minecraft has changed that this API can not adapt to. It is recommended you instead manually listen to the AsyncChatEvent or alternatively using Dialog to get user input.
A ConversationContext provides continuity between nodes in the prompt graph by giving the developer access to the subject of the conversation and a generic map for storing values that are shared between all Prompt invocations.
  • Constructor Details

    • ConversationContext

      public ConversationContext(@Nullable @Nullable Plugin plugin, @NotNull @NotNull Conversable forWhom, @NotNull @NotNull Map<Object,Object> initialSessionData)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      plugin - The owning plugin.
      forWhom - The subject of the conversation.
      initialSessionData - Any initial values to put in the sessionData map.
  • Method Details

    • getPlugin

      @Nullable public @Nullable Plugin getPlugin()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the plugin that owns this conversation.
      Returns:
      The owning plugin.
    • getForWhom

      @NotNull public @NotNull Conversable getForWhom()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the subject of the conversation.
      Returns:
      The subject of the conversation.
    • getAllSessionData

      @NotNull public @NotNull Map<Object,Object> getAllSessionData()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the underlying sessionData map. May be directly modified to manipulate session data.
      Returns:
      The full sessionData map.
    • getSessionData

      @Nullable public @Nullable Object getSessionData(@NotNull @NotNull Object key)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets session data shared between all Prompt invocations. Use this as a way to pass data through each Prompt as the conversation develops.
      Parameters:
      key - The session data key.
      Returns:
      The requested session data.
    • setSessionData

      public void setSessionData(@NotNull @NotNull Object key, @Nullable @Nullable Object value)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets session data shared between all Prompt invocations. Use this as a way to pass data through each prompt as the conversation develops.
      Parameters:
      key - The session data key.
      value - The session data value.