Interface PacketMappings
public interface PacketMappings
Mappings to transform packets between two protocol versions.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddMapping(PacketType packetType, PacketMapping mapping) Adds a packet mapping.voidaddMapping(State state, int unmappedId, PacketMapping mapping) Adds a packet mapping.static PacketMappingsdefault booleanhasMapping(PacketType packetType) Returns whether the given packet type has a mapping.default booleanhasMapping(State state, int unmappedId) Returns whether the given packet type has a mapping.@Nullable PacketMappingmappedPacket(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 stateunmappedId- 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
-