Package org.bukkit.event.player
Class AsyncPlayerPreLoginEvent
- java.lang.Object
-
- org.bukkit.event.Event
-
- org.bukkit.event.player.AsyncPlayerPreLoginEvent
-
public class AsyncPlayerPreLoginEvent extends Event
Stores details for players attempting to log in.This event is asynchronous, and not run using main thread.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAsyncPlayerPreLoginEvent.ResultBasic kick reasons for communicating to plugins
-
Constructor Summary
Constructors Constructor Description AsyncPlayerPreLoginEvent(@NotNull String name, @NotNull InetAddress ipAddress)Deprecated.AsyncPlayerPreLoginEvent(@NotNull String name, @NotNull InetAddress ipAddress, @NotNull UUID uniqueId)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidallow()Allows the player to log invoiddisallow(@NotNull AsyncPlayerPreLoginEvent.Result result, @NotNull String message)Disallows the player from logging in, with the given reasonvoiddisallow(PlayerPreLoginEvent.Result result, @NotNull String message)Deprecated.This method uses a deprecated enum fromPlayerPreLoginEvent@NotNull InetAddressgetAddress()Gets the player IP address.static @NotNull HandlerListgetHandlerList()@NotNull HandlerListgetHandlers()@NotNull StringgetKickMessage()Gets the current kick message that will be used if getResult() !@NotNull AsyncPlayerPreLoginEvent.ResultgetLoginResult()Gets the current result of the login, as an enum@NotNull StringgetName()Gets the player's name.PlayerPreLoginEvent.ResultgetResult()Deprecated.This method uses a deprecated enum fromPlayerPreLoginEvent@NotNull UUIDgetUniqueId()Gets the player's unique ID.voidsetKickMessage(@NotNull String message)Sets the kick message to display if getResult() !voidsetLoginResult(@NotNull AsyncPlayerPreLoginEvent.Result result)Sets the new result of the login, as an enumvoidsetResult(PlayerPreLoginEvent.Result result)Deprecated.This method uses a deprecated enum fromPlayerPreLoginEvent-
Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
-
-
-
Constructor Detail
-
AsyncPlayerPreLoginEvent
@Deprecated public AsyncPlayerPreLoginEvent(@NotNull @NotNull String name, @NotNull @NotNull InetAddress ipAddress)
Deprecated.
-
AsyncPlayerPreLoginEvent
public AsyncPlayerPreLoginEvent(@NotNull @NotNull String name, @NotNull @NotNull InetAddress ipAddress, @NotNull @NotNull UUID uniqueId)
-
-
Method Detail
-
getLoginResult
@NotNull public @NotNull AsyncPlayerPreLoginEvent.Result getLoginResult()
Gets the current result of the login, as an enum- Returns:
- Current Result of the login
-
getResult
@Deprecated @NotNull public PlayerPreLoginEvent.Result getResult()
Deprecated.This method uses a deprecated enum fromPlayerPreLoginEventGets the current result of the login, as an enum- Returns:
- Current Result of the login
- See Also:
getLoginResult()
-
setLoginResult
public void setLoginResult(@NotNull @NotNull AsyncPlayerPreLoginEvent.Result result)Sets the new result of the login, as an enum- Parameters:
result- New result to set
-
setResult
@Deprecated public void setResult(@NotNull PlayerPreLoginEvent.Result result)
Deprecated.This method uses a deprecated enum fromPlayerPreLoginEventSets the new result of the login, as an enum- Parameters:
result- New result to set- See Also:
setLoginResult(Result)
-
getKickMessage
@NotNull public @NotNull String getKickMessage()
Gets the current kick message that will be used if getResult() != Result.ALLOWED- Returns:
- Current kick message
-
setKickMessage
public void setKickMessage(@NotNull @NotNull String message)Sets the kick message to display if getResult() != Result.ALLOWED- Parameters:
message- New kick message
-
allow
public void allow()
Allows the player to log in
-
disallow
public void disallow(@NotNull @NotNull AsyncPlayerPreLoginEvent.Result result, @NotNull @NotNull String message)Disallows the player from logging in, with the given reason- Parameters:
result- New result for disallowing the playermessage- Kick message to display to the user
-
disallow
@Deprecated public void disallow(@NotNull PlayerPreLoginEvent.Result result, @NotNull @NotNull String message)
Deprecated.This method uses a deprecated enum fromPlayerPreLoginEventDisallows the player from logging in, with the given reason- Parameters:
result- New result for disallowing the playermessage- Kick message to display to the user- See Also:
disallow(Result, String)
-
getName
@NotNull public @NotNull String getName()
Gets the player's name.- Returns:
- the player's name
-
getAddress
@NotNull public @NotNull InetAddress getAddress()
Gets the player IP address.- Returns:
- The IP address
-
getUniqueId
@NotNull public @NotNull UUID getUniqueId()
Gets the player's unique ID.- Returns:
- The unique ID
-
getHandlers
@NotNull public @NotNull HandlerList getHandlers()
- Specified by:
getHandlersin classEvent
-
getHandlerList
@NotNull public static @NotNull HandlerList getHandlerList()
-
-