Interface PacketMappings


public interface PacketMappings
Mappings to transform packets between two protocol versions.
  • Method Details

    • mappedPacket

      @Nullable PacketMapping mappedPacket(State state, int unmappedId)
      Returns a packet mapping for the given packet.
      Parameters:
      state - protocol stae
      unmappedId - unmapped packet id
      Returns:
      packet mapping if present
    • hasMapping

      default boolean hasMapping(PacketType packetType)
      Returns whether the given packet type has a mapping.
      Parameters:
      packetType - unmapped packet type
      Returns:
      whether the given packet type has a mapping
    • hasMapping

      default boolean hasMapping(State state, int unmappedId)
      Returns whether the given packet type has a mapping.
      Parameters:
      state - protocol state
      unmappedId - unmapped packet id
      Returns:
      whether the given packet type has a mapping
    • addMapping

      default void addMapping(PacketType packetType, PacketMapping mapping)
      Adds a packet mapping.
      Parameters:
      packetType - unmapped packet type
      mapping - packet mapping
    • addMapping

      void addMapping(State state, int unmappedId, PacketMapping mapping)
      Adds a packet mapping.
      Parameters:
      state - protocol state
      unmappedId - unmapped packet id
      mapping - packet mapping
    • arrayMappings

      static PacketMappings arrayMappings()