类 ConversationContext

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

public class ConversationContext extends Object
ConversationContext 通过让开发者访问对话主题和一个通用映射来存储在所有 Prompt 调用之间共享的值, 从而在提示图中的节点之间提供连续性。
  • 构造器详细资料

  • 方法详细资料

    • getPlugin

      @Nullable public @Nullable Plugin getPlugin()
      获取拥有此对话的插件。

      原文: Gets the plugin that owns this conversation.

      返回:
      拥有此对话的插件。
    • getForWhom

      @NotNull public @NotNull Conversable getForWhom()
      获取对话的主题。

      原文: Gets the subject of the conversation.

      返回:
      对话的主题。
    • getAllSessionData

      @NotNull public @NotNull Map<Object,Object> getAllSessionData()
      获取底层的 sessionData 映射。可以直接修改以操作会话数据。

      原文: Gets the underlying sessionData map. May be directly modified to manipulate session data.

      返回:
      完整的 sessionData 映射。
    • getSessionData

      @Nullable public @Nullable Object getSessionData(@NotNull @NotNull Object key)
      获取在所有 Prompt 调用之间共享的会话数据。使用此方法作为在对话发展过程中通过每个 Prompt 传递数据的方式。

      原文: Gets session data shared between all Prompt invocations. Use this as a way to pass data through each Prompt as the conversation develops.

      参数:
      key - 会话数据的键。
      返回:
      请求的会话数据。
    • setSessionData

      public void setSessionData(@NotNull @NotNull Object key, @Nullable @Nullable Object value)
      设置在所有 Prompt 调用之间共享的会话数据。使用此方法作为在对话发展过程中通过每个提示传递数据的方式。

      原文: Sets session data shared between all Prompt invocations. Use this as a way to pass data through each prompt as the conversation develops.

      参数:
      key - 会话数据的键。
      value - 会话数据的值。