类的使用
org.bukkit.conversations.ConversationContext
使用ConversationContext的程序包
-
org.bukkit.conversations中ConversationContext的使用
修饰符和类型方法说明Conversation.getContext()Returns the Conversation'sConversationContext.ConversationAbandonedEvent.getContext()获取这个被终止的会话的上下文.修饰符和类型方法说明MessagePrompt.acceptInput(ConversationContext context, String input) Accepts and ignores any user input, returning the next prompt in the prompt graph instead.Prompt.acceptInput(ConversationContext context, String input) Accepts and processes input from the user.ValidatingPrompt.acceptInput(ConversationContext context, String input) Accepts and processes input from the user and validates it.protected abstract PromptBooleanPrompt.acceptValidatedInput(ConversationContext context, boolean input) 您可以重写这个方法,根据用户对提示的响应来执行对应的操作.protected PromptBooleanPrompt.acceptValidatedInput(ConversationContext context, String input) protected abstract PromptNumericPrompt.acceptValidatedInput(ConversationContext context, Number input) Override this method to perform some action with the user's integer response.protected PromptNumericPrompt.acceptValidatedInput(ConversationContext context, String input) protected PromptPlayerNamePrompt.acceptValidatedInput(ConversationContext context, String input) protected abstract PromptPlayerNamePrompt.acceptValidatedInput(ConversationContext context, Player input) Override this method to perform some action with the user's player name response.protected abstract PromptValidatingPrompt.acceptValidatedInput(ConversationContext context, String input) Override this method to accept and processes the validated input from the user.booleanMessagePrompt.blocksForInput(ConversationContext context) Message prompts never wait for user input before continuing.booleanPrompt.blocksForInput(ConversationContext context) Checks to see if this prompt implementation should wait for user input or immediately display the next prompt.booleanStringPrompt.blocksForInput(ConversationContext context) Ensures that the prompt waits for the user to provide input.booleanValidatingPrompt.blocksForInput(ConversationContext context) Ensures that the prompt waits for the user to provide input.booleanConversationCanceller.cancelBasedOnInput(ConversationContext context, String input) 根据用户的输入反馈取消一个会话.booleanExactMatchConversationCanceller.cancelBasedOnInput(ConversationContext context, String input) booleanInactivityConversationCanceller.cancelBasedOnInput(ConversationContext context, String input) booleanManuallyAbandonedConversationCanceller.cancelBasedOnInput(ConversationContext context, String input) protected StringNumericPrompt.getFailedValidationText(ConversationContext context, Number invalidInput) Optionally override this method to display an additional message if the user enters an invalid numeric input.protected StringNumericPrompt.getFailedValidationText(ConversationContext context, String invalidInput) protected StringValidatingPrompt.getFailedValidationText(ConversationContext context, String invalidInput) Optionally override this method to display an additional message if the user enters an invalid input.protected StringNumericPrompt.getInputNotNumericText(ConversationContext context, String invalidInput) Optionally override this method to display an additional message if the user enters an invalid number.protected abstract PromptMessagePrompt.getNextPrompt(ConversationContext context) Override this method to return the next prompt in the prompt graph.ConversationPrefix.getPrefix(ConversationContext context) Gets the prefix to use before each message to the player.NullConversationPrefix.getPrefix(ConversationContext context) Prepends each conversation message with an empty string.PluginNameConversationPrefix.getPrefix(ConversationContext context) Prepends each conversation message with the plugin name.Prompt.getPromptText(ConversationContext context) Gets the text to display to the user when this prompt is first presented.protected booleanBooleanPrompt.isInputValid(ConversationContext context, String input) protected booleanFixedSetPrompt.isInputValid(ConversationContext context, String input) protected booleanNumericPrompt.isInputValid(ConversationContext context, String input) protected booleanPlayerNamePrompt.isInputValid(ConversationContext context, String input) protected booleanRegexPrompt.isInputValid(ConversationContext context, String input) protected abstract booleanValidatingPrompt.isInputValid(ConversationContext context, String input) Override this method to check the validity of the player's input.protected booleanNumericPrompt.isNumberValid(ConversationContext context, 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.