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 class
AsyncPlayerPreLoginEvent.Result
Basic kick reasons for communicating to plugins -
Constructor Summary
Constructors Constructor Description AsyncPlayerPreLoginEvent(java.lang.String name, java.net.InetAddress ipAddress)
Deprecated.AsyncPlayerPreLoginEvent(java.lang.String name, java.net.InetAddress ipAddress, java.util.UUID uniqueId)
-
Method Summary
Modifier and Type Method Description void
allow()
Allows the player to log invoid
disallow(AsyncPlayerPreLoginEvent.Result result, java.lang.String message)
Disallows the player from logging in, with the given reasonvoid
disallow(PlayerPreLoginEvent.Result result, java.lang.String message)
Deprecated.This method uses a deprecated enum fromPlayerPreLoginEvent
java.net.InetAddress
getAddress()
Gets the player IP address.static HandlerList
getHandlerList()
HandlerList
getHandlers()
java.lang.String
getKickMessage()
Gets the current kick message that will be used if getResult() != Result.ALLOWEDAsyncPlayerPreLoginEvent.Result
getLoginResult()
Gets the current result of the login, as an enumjava.lang.String
getName()
Gets the player's name.PlayerPreLoginEvent.Result
getResult()
Deprecated.This method uses a deprecated enum fromPlayerPreLoginEvent
java.util.UUID
getUniqueId()
Gets the player's unique ID.void
setKickMessage(java.lang.String message)
Sets the kick message to display if getResult() != Result.ALLOWEDvoid
setLoginResult(AsyncPlayerPreLoginEvent.Result result)
Sets the new result of the login, as an enumvoid
setResult(PlayerPreLoginEvent.Result result)
Deprecated.This method uses a deprecated enum fromPlayerPreLoginEvent
-
Constructor Details
-
AsyncPlayerPreLoginEvent
@Deprecated public AsyncPlayerPreLoginEvent(java.lang.String name, java.net.InetAddress ipAddress)Deprecated. -
AsyncPlayerPreLoginEvent
public AsyncPlayerPreLoginEvent(java.lang.String name, java.net.InetAddress ipAddress, java.util.UUID uniqueId)
-
-
Method Details
-
getLoginResult
Gets the current result of the login, as an enum- Returns:
- Current Result of the login
-
getResult
Deprecated.This method uses a deprecated enum fromPlayerPreLoginEvent
Gets the current result of the login, as an enum- Returns:
- Current Result of the login
- See Also:
getLoginResult()
-
setLoginResult
Sets the new result of the login, as an enum- Parameters:
result
- New result to set
-
setResult
Deprecated.This method uses a deprecated enum fromPlayerPreLoginEvent
Sets the new result of the login, as an enum- Parameters:
result
- New result to set- See Also:
setLoginResult(Result)
-
getKickMessage
public java.lang.String getKickMessage()Gets the current kick message that will be used if getResult() != Result.ALLOWED- Returns:
- Current kick message
-
setKickMessage
public void setKickMessage(java.lang.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
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.This method uses a deprecated enum fromPlayerPreLoginEvent
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- See Also:
disallow(Result, String)
-
getName
public java.lang.String getName()Gets the player's name.- Returns:
- the player's name
-
getAddress
public java.net.InetAddress getAddress()Gets the player IP address.- Returns:
- The IP address
-
getUniqueId
public java.util.UUID getUniqueId()Gets the player's unique ID.- Returns:
- The unique ID
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-