public class AsyncPlayerPreLoginEvent extends Event
This event is asynchronous, and not run using main thread.
Modifier and Type | Class | Description |
---|---|---|
static class |
AsyncPlayerPreLoginEvent.Result |
Basic kick reasons for communicating to plugins
|
Constructor | Description |
---|---|
AsyncPlayerPreLoginEvent(String name,
InetAddress ipAddress) |
Deprecated.
|
AsyncPlayerPreLoginEvent(String name,
InetAddress ipAddress,
UUID uniqueId) |
|
AsyncPlayerPreLoginEvent(String name,
InetAddress ipAddress,
UUID uniqueId,
PlayerProfile profile) |
Modifier and Type | Method | Description |
---|---|---|
void |
allow() |
Allows the player to log in
|
void |
disallow(AsyncPlayerPreLoginEvent.Result result,
String message) |
Disallows the player from logging in, with the given reason
|
void |
disallow(PlayerPreLoginEvent.Result result,
String message) |
Deprecated.
This method uses a deprecated enum from
PlayerPreLoginEvent |
InetAddress |
getAddress() |
Gets the player IP address.
|
static HandlerList |
getHandlerList() |
|
HandlerList |
getHandlers() |
|
String |
getKickMessage() |
Gets the current kick message that will be used if getResult() !=
Result.ALLOWED
|
AsyncPlayerPreLoginEvent.Result |
getLoginResult() |
Gets the current result of the login, as an enum
|
String |
getName() |
Gets the player's name.
|
PlayerProfile |
getPlayerProfile() |
Gets the PlayerProfile of the player logging in
|
PlayerPreLoginEvent.Result |
getResult() |
Deprecated.
This method uses a deprecated enum from
PlayerPreLoginEvent |
UUID |
getUniqueId() |
Gets the player's unique ID.
|
void |
setKickMessage(String message) |
Sets the kick message to display if getResult() != Result.ALLOWED
|
void |
setLoginResult(AsyncPlayerPreLoginEvent.Result result) |
Sets the new result of the login, as an enum
|
void |
setPlayerProfile(PlayerProfile profile) |
Changes the PlayerProfile the player will login as
|
void |
setResult(PlayerPreLoginEvent.Result result) |
Deprecated.
This method uses a deprecated enum from
PlayerPreLoginEvent |
callEvent, getEventName, isAsynchronous
@Deprecated public AsyncPlayerPreLoginEvent(@NotNull String name, @NotNull InetAddress ipAddress)
public AsyncPlayerPreLoginEvent(@NotNull String name, @NotNull InetAddress ipAddress, @NotNull UUID uniqueId)
public AsyncPlayerPreLoginEvent(@NotNull String name, @NotNull InetAddress ipAddress, @NotNull UUID uniqueId, @NotNull PlayerProfile profile)
@NotNull public PlayerProfile getPlayerProfile()
public void setPlayerProfile(@NotNull PlayerProfile profile)
profile
- The profile to use@NotNull public AsyncPlayerPreLoginEvent.Result getLoginResult()
@Deprecated @NotNull public PlayerPreLoginEvent.Result getResult()
PlayerPreLoginEvent
getLoginResult()
public void setLoginResult(@NotNull AsyncPlayerPreLoginEvent.Result result)
result
- New result to set@Deprecated public void setResult(@NotNull PlayerPreLoginEvent.Result result)
PlayerPreLoginEvent
result
- New result to setsetLoginResult(Result)
@NotNull public String getKickMessage()
public void setKickMessage(@NotNull String message)
message
- New kick messagepublic void allow()
public void disallow(@NotNull AsyncPlayerPreLoginEvent.Result result, @NotNull String message)
result
- New result for disallowing the playermessage
- Kick message to display to the user@Deprecated public void disallow(@NotNull PlayerPreLoginEvent.Result result, @NotNull String message)
PlayerPreLoginEvent
result
- New result for disallowing the playermessage
- Kick message to display to the userdisallow(Result, String)
@NotNull public String getName()
@NotNull public InetAddress getAddress()
@NotNull public UUID getUniqueId()
@NotNull public HandlerList getHandlers()
getHandlers
in class Event
@NotNull public static HandlerList getHandlerList()
Copyright © 2020. All rights reserved.