# 类的使用
org.bukkit.conversations.ConversationContext

使用ConversationContext的程序包
程序包
说明
org.bukkit.conversations
致力于简化玩家与插件的直接通信的类(玩家与插件的对话，典型的场景比如操作的确认、提供插件所需数据).

- ## org.bukkit.conversations中ConversationContext的使用

  声明为ConversationContext的org.bukkit.conversations中的字段
  修饰符和类型
  字段
  说明
  `protected ConversationContext`
  Conversation.`context`
  返回ConversationContext的org.bukkit.conversations中的方法
  修饰符和类型
  方法
  说明
  `@NotNull ConversationContext`
  Conversation.`getContext()`
  Returns the Conversation's `ConversationContext`.
  `@NotNull ConversationContext`
  ConversationAbandonedEvent.`getContext()`
  获取这个被终止的会话的上下文.
  参数类型为ConversationContext的org.bukkit.conversations中的方法
  修饰符和类型
  方法
  说明
  `@Nullable Prompt`
  MessagePrompt.`acceptInput(@NotNull ConversationContext context, @Nullable String input)`
  Accepts and ignores any user input, returning the next prompt in the prompt graph instead.
  `@Nullable Prompt`
  Prompt.`acceptInput(@NotNull ConversationContext context, @Nullable String input)`
  Accepts and processes input from the user.
  `@Nullable Prompt`
  ValidatingPrompt.`acceptInput(@NotNull ConversationContext context, @Nullable String input)`
  Accepts and processes input from the user and validates it.
  `protected abstract @Nullable Prompt`
  BooleanPrompt.`acceptValidatedInput(@NotNull ConversationContext context, boolean input)`
  您可以重写这个方法，根据用户对提示的响应来执行对应的操作.
  `protected @Nullable Prompt`
  BooleanPrompt.`acceptValidatedInput(@NotNull ConversationContext context, @NotNull String input)`
  `protected abstract @Nullable Prompt`
  NumericPrompt.`acceptValidatedInput(@NotNull ConversationContext context, @NotNull Number input)`
  Override this method to perform some action with the user's integer response.
  `protected @Nullable Prompt`
  NumericPrompt.`acceptValidatedInput(@NotNull ConversationContext context, @NotNull String input)`
  `protected @Nullable Prompt`
  PlayerNamePrompt.`acceptValidatedInput(@NotNull ConversationContext context, @NotNull String input)`
  `protected abstract @Nullable Prompt`
  PlayerNamePrompt.`acceptValidatedInput(@NotNull ConversationContext context, @NotNull Player input)`
  Override this method to perform some action with the user's player name response.
  `protected abstract @Nullable Prompt`
  ValidatingPrompt.`acceptValidatedInput(@NotNull ConversationContext context, @NotNull String input)`
  Override this method to accept and processes the validated input from the user.
  `boolean`
  MessagePrompt.`blocksForInput(@NotNull ConversationContext context)`
  Message prompts never wait for user input before continuing.
  `boolean`
  Prompt.`blocksForInput(@NotNull ConversationContext context)`
  Checks to see if this prompt implementation should wait for user input or immediately display the next prompt.
  `boolean`
  StringPrompt.`blocksForInput(@NotNull ConversationContext context)`
  Ensures that the prompt waits for the user to provide input.
  `boolean`
  ValidatingPrompt.`blocksForInput(@NotNull ConversationContext context)`
  Ensures that the prompt waits for the user to provide input.
  `boolean`
  ConversationCanceller.`cancelBasedOnInput(@NotNull ConversationContext context, @NotNull String input)`
  根据用户的输入反馈取消一个会话.
  `boolean`
  ExactMatchConversationCanceller.`cancelBasedOnInput(@NotNull ConversationContext context, @NotNull String input)`
  `boolean`
  InactivityConversationCanceller.`cancelBasedOnInput(@NotNull ConversationContext context, @NotNull String input)`
  `boolean`
  ManuallyAbandonedConversationCanceller.`cancelBasedOnInput(@NotNull ConversationContext context, @NotNull String input)`
  `protected @Nullable String`
  NumericPrompt.`getFailedValidationText(@NotNull ConversationContext context, @NotNull Number invalidInput)`
  Optionally override this method to display an additional message if the user enters an invalid numeric input.
  `protected @Nullable String`
  NumericPrompt.`getFailedValidationText(@NotNull ConversationContext context, @NotNull String invalidInput)`
  `protected @Nullable String`
  ValidatingPrompt.`getFailedValidationText(@NotNull ConversationContext context, @NotNull String invalidInput)`
  Optionally override this method to display an additional message if the user enters an invalid input.
  `protected @Nullable String`
  NumericPrompt.`getInputNotNumericText(@NotNull ConversationContext context, @NotNull String invalidInput)`
  Optionally override this method to display an additional message if the user enters an invalid number.
  `protected abstract @Nullable Prompt`
  MessagePrompt.`getNextPrompt(@NotNull ConversationContext context)`
  Override this method to return the next prompt in the prompt graph.
  `@NotNull String`
  ConversationPrefix.`getPrefix(@NotNull ConversationContext context)`
  Gets the prefix to use before each message to the player.
  `@NotNull String`
  NullConversationPrefix.`getPrefix(@NotNull ConversationContext context)`
  Prepends each conversation message with an empty string.
  `@NotNull String`
  PluginNameConversationPrefix.`getPrefix(@NotNull ConversationContext context)`
  Prepends each conversation message with the plugin name.
  `@NotNull String`
  Prompt.`getPromptText(@NotNull ConversationContext context)`
  Gets the text to display to the user when this prompt is first presented.
  `protected boolean`
  BooleanPrompt.`isInputValid(@NotNull ConversationContext context, @NotNull String input)`
  `protected boolean`
  FixedSetPrompt.`isInputValid(@NotNull ConversationContext context, @NotNull String input)`
  `protected boolean`
  NumericPrompt.`isInputValid(@NotNull ConversationContext context, @NotNull String input)`
  `protected boolean`
  PlayerNamePrompt.`isInputValid(@NotNull ConversationContext context, @NotNull String input)`
  `protected boolean`
  RegexPrompt.`isInputValid(@NotNull ConversationContext context, @NotNull String input)`
  `protected abstract boolean`
  ValidatingPrompt.`isInputValid(@NotNull ConversationContext context, @NotNull String input)`
  Override this method to check the validity of the player's input.
  `protected boolean`
  NumericPrompt.`isNumberValid(@NotNull ConversationContext context, @NotNull Number input)`
  Override this method to do further validation on the numeric player input after the input has been determined to actually be a number.