Interface PacketMappings
public interface PacketMappings
Mappings to transform packets between two protocol versions.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
addMapping
(PacketType packetType, PacketMapping mapping) Adds a packet mapping.void
addMapping
(State state, int unmappedId, PacketMapping mapping) Adds a packet mapping.static PacketMappings
default boolean
hasMapping
(PacketType packetType) Returns whether the given packet type has a mapping.default boolean
hasMapping
(State state, int unmappedId) Returns whether the given packet type has a mapping.@Nullable PacketMapping
mappedPacket
(State state, int unmappedId) Returns a packet mapping for the given packet.
-
Method Details
-
mappedPacket
Returns a packet mapping for the given packet.- Parameters:
state
- protocol staeunmappedId
- unmapped packet id- Returns:
- packet mapping if present
-
hasMapping
Returns whether the given packet type has a mapping.- Parameters:
packetType
- unmapped packet type- Returns:
- whether the given packet type has a mapping
-
hasMapping
Returns whether the given packet type has a mapping.- Parameters:
state
- protocol stateunmappedId
- unmapped packet id- Returns:
- whether the given packet type has a mapping
-
addMapping
Adds a packet mapping.- Parameters:
packetType
- unmapped packet typemapping
- packet mapping
-
addMapping
Adds a packet mapping.- Parameters:
state
- protocol stateunmappedId
- unmapped packet idmapping
- packet mapping
-
arrayMappings
-