Enum Class Destination

java.lang.Object
java.lang.Enum<Destination>
net.darkhax.bookshelf.common.api.network.Destination
All Implemented Interfaces:
Serializable, Comparable<Destination>, Constable

public enum Destination extends Enum<Destination>
Determines where the packet will be resolved.
  • Enum Constant Details

    • SERVER_TO_CLIENT

      public static final Destination SERVER_TO_CLIENT
      Describes a situation where the server has a payload that will be sent to a client. The payload will be handled on the client and can use code that is only available on a dedicated client.
    • CLIENT_TO_SERVER

      public static final Destination CLIENT_TO_SERVER
      Describes a situation where the client has a payload that will be sent to a server. The payload will be handled by the server and can access the game state. Please keep in mind that payloads originating on the client can be forged and should not be trusted without an appropriate level of validation on the server.
    • BIDIRECTIONAL

      public static final Destination BIDIRECTIONAL
      Describes a situation where the packet can originate from and be handled by a client or a server. These packets have the limitations of both SERVER_TOL_CLIENT and CLIENT_TO_SERVER packets.
  • Method Details

    • values

      public static Destination[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Destination valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • handledByServer

      public boolean handledByServer()
      Checks if the payload can be handled on a server.
      Returns:
      If the payload can be handled by a server.
    • handledByClient

      public boolean handledByClient()
      Checks if the payload can be handled on a client.
      Returns:
      If the payload can be handled by a client.