Class AbstractInputHandler
java.lang.Object
top.magstar.framework.input.abstraction.AbstractInputHandler
- All Implemented Interfaces:
InputHandler
输入处理器抽象实现 - 实现了会话管理和call方法
- Since:
- 1.0.0
- Version:
- 1.0.0
- Author:
- Berry_so
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class输入会话类 - 管理单个玩家的输入会话 -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean是否在受伤时取消protected boolean是否在移动时取消protected long超时时间(毫秒),0表示永不超时 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcall(@NotNull org.bukkit.entity.Player player) 将输入会话应用到指定玩家getSession(org.bukkit.entity.Player player) 获取玩家的活跃会话static booleanhasSession(org.bukkit.entity.Player player) 检查玩家是否有活跃会话static voidremoveSession(org.bukkit.entity.Player player) 移除玩家的会话Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface top.magstar.framework.input.interfaces.InputHandler
getPromptMessage, nextInput, onAccept, onCancel, onDenied, onTimeout, validateInput
-
Field Details
-
timeout
protected long timeout超时时间(毫秒),0表示永不超时 -
cancelOnMove
protected boolean cancelOnMove是否在移动时取消 -
cancelOnDamage
protected boolean cancelOnDamage是否在受伤时取消
-
-
Constructor Details
-
AbstractInputHandler
public AbstractInputHandler()
-
-
Method Details
-
call
public void call(@NotNull @NotNull org.bukkit.entity.Player player) Description copied from interface:InputHandler将输入会话应用到指定玩家- Specified by:
callin interfaceInputHandler- Parameters:
player- 目标玩家
-
getSession
获取玩家的活跃会话- Parameters:
player- 玩家- Returns:
- 玩家的输入会话,如果不存在则返回null
-
removeSession
public static void removeSession(org.bukkit.entity.Player player) 移除玩家的会话- Parameters:
player- 玩家
-
hasSession
public static boolean hasSession(org.bukkit.entity.Player player) 检查玩家是否有活跃会话- Parameters:
player- 玩家- Returns:
- true表示有活跃会话,false表示没有
-