Class CookieStoreEvent
java.lang.Object
com.velocitypowered.api.event.player.CookieStoreEvent
- All Implemented Interfaces:
ResultedEvent<CookieStoreEvent.ForwardResult>
@AwaitingEvent
public final class CookieStoreEvent
extends Object
implements ResultedEvent<CookieStoreEvent.ForwardResult>
This event is fired when a cookie should be stored on a player's client. This process can be
initiated either by a proxy plugin or by a backend server. Velocity will wait on this event
to finish firing before discarding the cookie (if handled) or forwarding it to the client so
that it can store the cookie.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA result determining whether or not to forward the cookie on.Nested classes/interfaces inherited from interface com.velocitypowered.api.event.ResultedEvent
ResultedEvent.ComponentResult, ResultedEvent.GenericResult, ResultedEvent.Result -
Constructor Summary
ConstructorsConstructorDescriptionCookieStoreEvent(Player player, Key key, byte[] data) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Returns the original data of the cookie to be stored.Returns the original key identifying the cookie to be stored.Returns the player who should store the cookie.Returns the result associated with this event.voidSets the result of this event.toString()
-
Constructor Details
-
CookieStoreEvent
Creates a new instance.- Parameters:
player- the player who should store the cookiekey- 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<CookieStoreEvent.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<CookieStoreEvent.ForwardResult>- Parameters:
result- the new result
-
getPlayer
Returns the player who should store the cookie.- Returns:
- the player
-
getOriginalKey
Returns the original key identifying the cookie to be stored.- Returns:
- the cookie key
-
getOriginalData
public byte[] getOriginalData()Returns the original data of the cookie to be stored.- Returns:
- the cookie data
-
toString
-