类 FixedSetPrompt
java.lang.Object
org.bukkit.conversations.ValidatingPrompt
org.bukkit.conversations.FixedSetPrompt
FixedSetPrompt 是任何需要用户从固定集合中响应的提示的基类。
-
字段概要
字段从接口继承的字段 org.bukkit.conversations.Prompt
END_OF_CONVERSATION -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明创建一个包含构造函数中声明的所有选项的格式化字符串的实用函数。protected booleanisInputValid(@NotNull ConversationContext context, @NotNull String input) 覆盖此方法以检查玩家输入的有效性。从类继承的方法 org.bukkit.conversations.ValidatingPrompt
acceptInput, acceptValidatedInput, blocksForInput, getFailedValidationText从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 org.bukkit.conversations.Prompt
getPromptText
-
字段详细资料
-
fixedSet
-
-
构造器详细资料
-
FixedSetPrompt
从一组字符串创建一个 FixedSetPrompt。foo = new FixedSetPrompt("bar", "cheese", "panda");
原文: Creates a FixedSetPrompt from a set of strings.
foo = new FixedSetPrompt("bar", "cheese", "panda");
- 参数:
fixedSet- 一组固定的字符串,用户必须输入其中之一。
-
-
方法详细资料
-
isInputValid
protected boolean isInputValid(@NotNull @NotNull ConversationContext context, @NotNull @NotNull String input) 从类复制的说明:ValidatingPrompt覆盖此方法以检查玩家输入的有效性。原文: Override this method to check the validity of the player's input.
- 指定者:
isInputValid在类中ValidatingPrompt- 参数:
context- 关于对话的上下文信息。input- 玩家的原始控制台输入。- 返回:
- 根据输入的有效性返回 true 或 false。
-
formatFixedSet
创建一个包含构造函数中声明的所有选项的格式化字符串的实用函数。原文: Utility function to create a formatted string containing all the options declared in the constructor.
- 返回:
- 格式化的选项,如 "[bar, cheese, panda]"(如果 bar、cheese 和 panda 是使用的选项)。
-