public class PlayerLoginEvent extends PlayerEvent
Modifier and Type | Class | Description |
---|---|---|
static class |
PlayerLoginEvent.Result |
Basic kick reasons for communicating to plugins
|
player
Constructor | Description |
---|---|
PlayerLoginEvent(Player player,
java.lang.String hostname,
java.net.InetAddress address) |
|
PlayerLoginEvent(Player player,
java.lang.String hostname,
java.net.InetAddress address,
java.net.InetAddress realAddress) |
This constructor defaults message to an empty string, and result to
ALLOWED
|
PlayerLoginEvent(Player player,
java.lang.String hostname,
java.net.InetAddress address,
PlayerLoginEvent.Result result,
java.lang.String message,
java.net.InetAddress realAddress) |
This constructor pre-configures the event with a result and message
|
Modifier and Type | Method | Description |
---|---|---|
void |
allow() |
Allows the player to log in
|
void |
disallow(PlayerLoginEvent.Result result,
java.lang.String message) |
Disallows the player from logging in, with the given reason
|
java.net.InetAddress |
getAddress() |
Gets the
InetAddress for the Player associated with this event. |
static HandlerList |
getHandlerList() |
|
HandlerList |
getHandlers() |
|
java.lang.String |
getHostname() |
Gets the hostname that the player used to connect to the server, or
blank if unknown
|
java.lang.String |
getKickMessage() |
Gets the current kick message that will be used if getResult() !=
Result.ALLOWED
|
java.net.InetAddress |
getRealAddress() |
Gets the connection address of this player, regardless of whether it has been spoofed or not.
|
PlayerLoginEvent.Result |
getResult() |
Gets the current result of the login, as an enum
|
void |
setKickMessage(java.lang.String message) |
Sets the kick message to display if getResult() != Result.ALLOWED
|
void |
setResult(PlayerLoginEvent.Result result) |
Sets the new result of the login, as an enum
|
getEventName, isAsynchronous
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPlayer
public PlayerLoginEvent(Player player, java.lang.String hostname, java.net.InetAddress address, java.net.InetAddress realAddress)
player
- The Player
for this eventhostname
- The hostname that was used to connect to the serveraddress
- The address the player used to connect, provided for
timing issuespublic PlayerLoginEvent(Player player, java.lang.String hostname, java.net.InetAddress address)
public PlayerLoginEvent(Player player, java.lang.String hostname, java.net.InetAddress address, PlayerLoginEvent.Result result, java.lang.String message, java.net.InetAddress realAddress)
player
- The Player
for this eventhostname
- The hostname that was used to connect to the serveraddress
- The address the player used to connect, provided for
timing issuesresult
- The result status for this eventmessage
- The message to be displayed if result denies loginpublic java.net.InetAddress getRealAddress()
public PlayerLoginEvent.Result getResult()
public void setResult(PlayerLoginEvent.Result result)
result
- New result to setpublic java.lang.String getKickMessage()
public void setKickMessage(java.lang.String message)
message
- New kick messagepublic java.lang.String getHostname()
public void allow()
public void disallow(PlayerLoginEvent.Result result, java.lang.String message)
result
- New result for disallowing the playermessage
- Kick message to display to the userpublic java.net.InetAddress getAddress()
InetAddress
for the Player associated with this event.
This method is provided as a workaround for player.getAddress()
returning null during PlayerLoginEvent.public HandlerList getHandlers()
getHandlers
in class Event
public static HandlerList getHandlerList()
Copyright © 2018. All rights reserved.