Class ChatInputAPI
java.lang.Object
io.github.lucfr1746.llibrary.chatinput.ChatInputAPI
API for handling chat input interactions with players.
 Allows setting various parameters like flags, allowed commands, messages, and timeouts.
- 
Constructor SummaryConstructorsConstructorDescriptionChatInputAPI(org.bukkit.plugin.java.JavaPlugin plugin, org.bukkit.entity.Player player, ChatInput inputType) Constructs a new ChatInputAPI instance.
- 
Method SummaryModifier and TypeMethodDescriptionstatic ChatInputAPIcreate(org.bukkit.plugin.java.JavaPlugin plugin, org.bukkit.entity.Player player, ChatInput inputType) Creates a new instance of ChatInputAPI.voidExecutes the chat input prompt and processes the response.voidexecute(@NotNull Consumer<String> onSuccess, @NotNull Consumer<InputStatus> onFailure) Executes the chat input prompt and provides callbacks for both success and failure cases.setAllowedCommands(@NotNull String... commands) Sets allowed commands during input.setAllowedCommands(@NotNull List<String> commands) Sets allowed commands during input.setAttempts(int attempts) Sets the maximum number of attempts allowed.Sets input flags.setMessage(@NotNull InputMessage inputMessage, @NotNull String message) Sets a custom message for the chat input prompt.setTimeout(int timeout) Sets the timeout duration for the chat input.
- 
Constructor Details- 
ChatInputAPIpublic ChatInputAPI(org.bukkit.plugin.java.JavaPlugin plugin, org.bukkit.entity.Player player, ChatInput inputType) Constructs a new ChatInputAPI instance.- Parameters:
- plugin- The plugin instance.
- player- The player who will provide input.
- inputType- The type of chat input to handle.
- Throws:
- NullPointerException- if any parameter is null.
 
 
- 
- 
Method Details- 
createpublic static ChatInputAPI create(org.bukkit.plugin.java.JavaPlugin plugin, org.bukkit.entity.Player player, ChatInput inputType) Creates a new instance of ChatInputAPI.- Parameters:
- plugin- The plugin instance.
- player- The player who will provide input.
- inputType- The type of chat input to handle.
- Returns:
- A new ChatInputAPI instance.
 
- 
setFlagsSets input flags.- Parameters:
- inputFlags- Flags to set.
- Returns:
- The current ChatInputAPI instance for method chaining.
 
- 
setAttemptsSets the maximum number of attempts allowed.- Parameters:
- attempts- The number of attempts.
- Returns:
- The current ChatInputAPI instance for method chaining.
 
- 
setAllowedCommandsSets allowed commands during input.- Parameters:
- commands- List of allowed commands.
- Returns:
- The current ChatInputAPI instance for method chaining.
 
- 
setAllowedCommandsSets allowed commands during input.- Parameters:
- commands- Array of allowed commands.
- Returns:
- The current ChatInputAPI instance for method chaining.
 
- 
setMessagepublic ChatInputAPI setMessage(@NotNull @NotNull InputMessage inputMessage, @NotNull @NotNull String message) Sets a custom message for the chat input prompt.- Parameters:
- inputMessage- The type of message to set.
- message- The message text.
- Returns:
- The current ChatInputAPI instance for method chaining.
 
- 
setTimeoutSets the timeout duration for the chat input.- Parameters:
- timeout- Timeout in seconds.
- Returns:
- The current ChatInputAPI instance for method chaining.
 
- 
executeExecutes the chat input prompt and processes the response.- Parameters:
- onSuccess- Callback function to handle successful input.
 
- 
executepublic void execute(@NotNull @NotNull Consumer<String> onSuccess, @NotNull @NotNull Consumer<InputStatus> onFailure) Executes the chat input prompt and provides callbacks for both success and failure cases.- Parameters:
- onSuccess- Callback function to handle successful input.
- onFailure- Callback function to handle input failures.
 
 
-