Interface CookieJar

All Known Implementing Classes:
ServerCommonNetworkHandlerMixin, ServerLoginNetworkHandlerMixin, ServerPlayerEntityMixin

public interface CookieJar
  • Method Summary

    Modifier and Type
    Method
    Description
    default <T> CompletableFuture<T>
    getCookie(Class<T> cookieType)
    Retrieves the cookie stored on the client.
    default void
    setCookie(Object cookie)
    Store a cookie on the client.
    default void
    transfer(String address, int port)
    Transfer the client to another server.
    boolean
    Checks if this client was transferred from another server.
  • Method Details

    • transfer

      default void transfer(String address, int port)
      Transfer the client to another server.
      Parameters:
      address - The address of the server to transfer to.
      port - The port of the server to transfer to.
    • wasTransferred

      boolean wasTransferred()
      Checks if this client was transferred from another server.

      NOTE: The client is able to lie about being transferred, so don't rely on it for mission critical things. Also see Biscuit.RegisteredCookie.kickIfMissing(boolean)
      Returns:
      If the client was transferred.
    • setCookie

      default void setCookie(Object cookie)
      Store a cookie on the client.
      Parameters:
      cookie - the object to store on the client.
    • getCookie

      default <T> CompletableFuture<T> getCookie(Class<T> cookieType)
      Retrieves the cookie stored on the client.
      Parameters:
      cookieType - The class type of the object to be retrieved.
      Returns:
      The object that was stored on the client.