Interface InputHandler

All Known Implementing Classes:
AbstractInputHandler

public interface InputHandler
玩家输入处理器接口 - 支持流式处理和链式调用
Since:
1.0.0
Version:
1.0.0
Author:
Berry_so
See Also:
  • Method Details

    • validateInput

      boolean validateInput(@NotNull @NotNull String input)
      验证输入是否有效
      Parameters:
      input - 玩家输入的内容
      Returns:
      true表示接受输入,false表示拒绝输入
    • onCancel

      @Nullable @Nullable Consumer<org.bukkit.entity.Player> onCancel()
      获取取消输入时的回调
      Returns:
      取消回调函数,null表示不处理
    • onTimeout

      @Nullable @Nullable Consumer<org.bukkit.entity.Player> onTimeout()
      获取输入超时时的回调
      Returns:
      超时回调函数,null表示不处理
    • onAccept

      @Nullable @Nullable InputAcceptCallback onAccept()
      获取接受输入时的回调
      Returns:
      接受回调函数,接收玩家和输入内容,null表示不处理
    • onDenied

      @Nullable @Nullable InputDeniedCallback onDenied()
      获取拒绝输入时的回调
      Returns:
      拒绝回调函数,接收玩家和输入内容,null表示不处理
    • nextInput

      @Nullable @Nullable InputHandler nextInput()
      获取下一个输入处理器(用于链式输入)
      Returns:
      下一个输入处理器,null表示没有后续输入
    • getPromptMessage

      @NotNull @NotNull SmartString getPromptMessage()
      获取提示消息
      Returns:
      提示消息
    • call

      void call(@NotNull @NotNull org.bukkit.entity.Player player)
      将输入会话应用到指定玩家
      Parameters:
      player - 目标玩家