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(@NotNull String originalHandshake,
boolean cancelled) |
Creates a new
PlayerHandshakeEvent . |
Modifier and Type | Method | Description |
---|---|---|
@NotNull String |
getFailMessage() |
Gets the message to display to the client when authentication fails.
|
static @NotNull HandlerList |
getHandlerList() |
|
@NotNull HandlerList |
getHandlers() |
|
@NotNull String |
getOriginalHandshake() |
Gets the original handshake string.
|
@Nullable String |
getPropertiesJson() |
Gets the profile properties.
|
@Nullable String |
getServerHostname() |
Gets the server hostname string.
|
@Nullable String |
getSocketAddressHostname() |
Gets the socket address hostname string.
|
@Nullable 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(@NotNull String failMessage) |
Sets the message to display to the client when authentication fails.
|
void |
setPropertiesJson(@NotNull String propertiesJson) |
Sets the profile properties.
|
void |
setServerHostname(@NotNull String serverHostname) |
Sets the server hostname string.
|
void |
setSocketAddressHostname(@NotNull String socketAddressHostname) |
Sets the socket address hostname string.
|
void |
setUniqueId(@NotNull UUID uniqueId) |
Sets the unique id.
|
callEvent, getEventName, isAsynchronous
public PlayerHandshakeEvent(@NotNull @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 @NotNull String getOriginalHandshake()
@Nullable public @Nullable String getServerHostname()
This should not include the port.
public void setServerHostname(@NotNull @NotNull String serverHostname)
This should not include the port.
serverHostname
- the server hostname string@Nullable public @Nullable String getSocketAddressHostname()
This should not include the port.
public void setSocketAddressHostname(@NotNull @NotNull String socketAddressHostname)
This should not include the port.
socketAddressHostname
- the socket address hostname string@Nullable public @Nullable UUID getUniqueId()
public void setUniqueId(@NotNull @NotNull UUID uniqueId)
uniqueId
- the unique id@Nullable public @Nullable 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 @NotNull String propertiesJson)
This should be a valid JSON string.
propertiesJson
- the profile properties, as JSON@NotNull public @NotNull String getFailMessage()
public void setFailMessage(@NotNull @NotNull String failMessage)
failMessage
- the message to display to the client@NotNull public @NotNull HandlerList getHandlers()
getHandlers
in class Event
@NotNull public static @NotNull HandlerList getHandlerList()
Copyright © 2020. All rights reserved.