类 PlayerLoginEvent
-
嵌套类概要
嵌套类 -
字段概要
从类继承的字段 org.bukkit.event.player.PlayerEvent
player -
构造器概要
构造器构造器说明PlayerLoginEvent(Player player, String hostname, InetAddress address) 这个构造器默认踢出消息为空、登录状态为ALLOWEDPlayerLoginEvent(Player player, String hostname, InetAddress address, PlayerLoginEvent.Result result, String message) 此构造器预配置事件的结果和消息. -
方法概要
修饰符和类型方法说明voidallow()允许玩家登录voiddisallow(PlayerLoginEvent.Result result, String message) 以给定的理由不允许玩家登录获取玩家的IP地址.static HandlerList获取玩家用于连接服务器的主机名,如果未知则为空如果getResult() !获取当前的登录状态.voidsetKickMessage(String message) 如果getResult() !voidsetResult(PlayerLoginEvent.Result result) 设置登录的状态.从类继承的方法 org.bukkit.event.player.PlayerEvent
getPlayer从类继承的方法 org.bukkit.event.Event
getEventName, isAsynchronous
-
构造器详细资料
-
PlayerLoginEvent
这个构造器默认踢出消息为空、登录状态为ALLOWED原文: This constructor defaults message to an empty string, and result to ALLOWED
- 参数:
player- 这个事件的玩家hostname- 用于连接服务器的主机名address- 玩家的IP地址
-
PlayerLoginEvent
public PlayerLoginEvent(Player player, String hostname, InetAddress address, PlayerLoginEvent.Result result, String message) 此构造器预配置事件的结果和消息.原文:This constructor pre-configures the event with a result and message
- 参数:
player- 这个事件的玩家hostname- 用于连接服务器的主机名address- 玩家的IP地址result- 事件的登录状态结果message- 拒绝登录时显示的消息
-
-
方法详细资料
-
getResult
获取当前的登录状态.原文:Gets the current result of the login, as an enum
- 返回:
- 登录状态
-
setResult
设置登录的状态.原文:Sets the new result of the login, as an enum
- 参数:
result- 登录状态
-
getKickMessage
如果getResult() != Result.ALLOWED,获取将使用的踢出消息原文:Gets the current kick message that will be used if getResult() != Result.ALLOWED
- 返回:
- 踢出消息
-
setKickMessage
如果getResult() != Result.ALLOWED,设置要显示的踢出消息原文:Sets the kick message to display if getResult() != Result.ALLOWED
- 参数:
message- 踢出消息
-
getHostname
获取玩家用于连接服务器的主机名,如果未知则为空原文:Gets the hostname that the player used to connect to the server, or blank if unknown
- 返回:
- 主机名
-
allow
public void allow()允许玩家登录原文:Allows the player to log in
-
disallow
以给定的理由不允许玩家登录原文:Disallows the player from logging in, with the given reason
- 参数:
result- 不允许玩家登录的理由message- 给用户显示的踢出消息
-
getAddress
获取玩家的IP地址. 这个方法是在此事件期间使用player.getAddress()为null的解决办法原文:Gets the
InetAddressfor the Player associated with this event. This method is provided as a workaround for player.getAddress() returning null during PlayerLoginEvent.- 返回:
- 玩家的IP地址。为兼容旧版,这可能是null
-
getHandlers
- 指定者:
getHandlers在类中Event
-
getHandlerList
-