Cancellable
public class PlayerHandshakeEvent extends Event implements Cancellable
If there are no listeners listening to this event, the logic default to your server platform will be ran.
WARNING: TAMPERING WITH THIS EVENT CAN BE DANGEROUS
Event.Result
Constructor | Description |
---|---|
PlayerHandshakeEvent(String originalHandshake,
boolean cancelled) |
Creates a new
PlayerHandshakeEvent . |
Modifier and Type | Method | Description |
---|---|---|
String |
getFailMessage() |
Gets the message to display to the client when authentication fails.
|
static HandlerList |
getHandlerList() |
|
HandlerList |
getHandlers() |
|
String |
getOriginalHandshake() |
Gets the original handshake string.
|
String |
getPropertiesJson() |
Gets the profile properties.
|
String |
getServerHostname() |
Gets the server hostname string.
|
String |
getSocketAddressHostname() |
Gets the socket address hostname string.
|
UUID |
getUniqueId() |
Gets the unique id.
|
boolean |
isCancelled() |
Determines if this event is cancelled.
|
boolean |
isFailed() |
Determines if authentication failed.
|
void |
setCancelled(boolean cancelled) |
Sets if this event is cancelled.
|
void |
setFailed(boolean failed) |
Sets if authentication failed and the client should be disconnected.
|
void |
setFailMessage(String failMessage) |
Sets the message to display to the client when authentication fails.
|
void |
setPropertiesJson(String propertiesJson) |
Sets the profile properties.
|
void |
setServerHostname(String serverHostname) |
Sets the server hostname string.
|
void |
setSocketAddressHostname(String socketAddressHostname) |
Sets the socket address hostname string.
|
void |
setUniqueId(UUID uniqueId) |
Sets the unique id.
|
callEvent, getEventName, isAsynchronous
public PlayerHandshakeEvent(@NotNull String originalHandshake, boolean cancelled)
PlayerHandshakeEvent
.originalHandshake
- the original handshake stringcancelled
- if this event is enabledpublic boolean isCancelled()
When this event is cancelled, custom handshake logic will not be processed.
isCancelled
in interface Cancellable
true
if this event is cancelled, false
otherwisepublic void setCancelled(boolean cancelled)
When this event is cancelled, custom handshake logic will not be processed.
setCancelled
in interface Cancellable
cancelled
- true
if this event is cancelled, false
otherwise@NotNull public String getOriginalHandshake()
@Nullable public String getServerHostname()
This should not include the port.
public void setServerHostname(@NotNull String serverHostname)
This should not include the port.
serverHostname
- the server hostname string@Nullable public String getSocketAddressHostname()
This should not include the port.
public void setSocketAddressHostname(@NotNull String socketAddressHostname)
This should not include the port.
socketAddressHostname
- the socket address hostname string@Nullable public UUID getUniqueId()
public void setUniqueId(@NotNull UUID uniqueId)
uniqueId
- the unique id@Nullable public String getPropertiesJson()
This should be a valid JSON string.
public boolean isFailed()
When true
, the client connecting will be disconnected
with the fail message
.
true
if authentication failed, false
otherwisepublic void setFailed(boolean failed)
When true
, the client connecting will be disconnected
with the fail message
.
failed
- true
if authentication failed, false
otherwisepublic void setPropertiesJson(@NotNull String propertiesJson)
This should be a valid JSON string.
propertiesJson
- the profile properties, as JSON@NotNull public String getFailMessage()
public void setFailMessage(@NotNull String failMessage)
failMessage
- the message to display to the client@NotNull public HandlerList getHandlers()
getHandlers
in class Event
@NotNull public static HandlerList getHandlerList()
Copyright © 2020. All rights reserved.