Class CookieReceiveEvent
java.lang.Object
com.velocitypowered.api.event.player.CookieReceiveEvent
- All Implemented Interfaces:
ResultedEvent<CookieReceiveEvent.ForwardResult>
@AwaitingEvent
public final class CookieReceiveEvent
extends Object
implements ResultedEvent<CookieReceiveEvent.ForwardResult>
This event is fired when a cookie response from a client is received by the proxy.
This usually happens after either a proxy plugin or a backend server requested a cookie.
Velocity will wait on this event to finish firing before discarding the
received cookie (if handled) or forwarding it to the backend server.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA result determining whether or not to forward the cookie response on.Nested classes/interfaces inherited from interface com.velocitypowered.api.event.ResultedEvent
ResultedEvent.ComponentResult, ResultedEvent.GenericResult, ResultedEvent.Result -
Constructor Summary
ConstructorsConstructorDescriptionCookieReceiveEvent(Player player, Key key, byte @Nullable [] data) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionbyte @Nullable []Returns the original cookie data received from the client, if present.Returns the original cookie identifier received from the client.Returns the player who sent the cookie response.Returns the result associated with this event.voidSets the result of this event.toString()
-
Constructor Details
-
CookieReceiveEvent
Creates a new instance.- Parameters:
player- the player who sent the cookie responsekey- the identifier of the cookiedata- the data of the cookie
-
-
Method Details
-
getResult
Description copied from interface:ResultedEventReturns the result associated with this event.- Specified by:
getResultin interfaceResultedEvent<CookieReceiveEvent.ForwardResult>- Returns:
- the result of this event
-
setResult
Description copied from interface:ResultedEventSets the result of this event. The result must be non-null.- Specified by:
setResultin interfaceResultedEvent<CookieReceiveEvent.ForwardResult>- Parameters:
result- the new result
-
getPlayer
Returns the player who sent the cookie response.- Returns:
- the player
-
getOriginalKey
Returns the original cookie identifier received from the client.- Returns:
- the original cookie key
-
getOriginalData
public byte @Nullable [] getOriginalData()Returns the original cookie data received from the client, if present.- Returns:
- the original cookie data, or
nullif not present
-
toString
-