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 and Description |
---|
PlayerHandshakeEvent(String originalHandshake,
boolean cancelled)
Creates a new
PlayerHandshakeEvent . |
Modifier and Type | Method and 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(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
otherwisepublic String getOriginalHandshake()
public String getServerHostname()
This should not include the port.
public void setServerHostname(String serverHostname)
This should not include the port.
serverHostname
- the server hostname stringpublic String getSocketAddressHostname()
This should not include the port.
public void setSocketAddressHostname(String socketAddressHostname)
This should not include the port.
socketAddressHostname
- the socket address hostname stringpublic UUID getUniqueId()
public void setUniqueId(UUID uniqueId)
uniqueId
- the unique idpublic 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(String propertiesJson)
This should be a valid JSON string.
propertiesJson
- the profile properties, as JSONpublic String getFailMessage()
public void setFailMessage(String failMessage)
failMessage
- the message to display to the clientpublic HandlerList getHandlers()
getHandlers
in class Event
public static HandlerList getHandlerList()
Copyright © 2021. All rights reserved.