Interface PacketMapping
public interface PacketMapping
Packet mapping over packet types or ids containing a packet transformer.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
appendHandler
(PacketHandler handler) Appends a packet transformer to the current packet transformer.void
applyType
(PacketWrapper wrapper) Applies the changed packet type or id to the given packet wrapper.@Nullable PacketHandler
handler()
Returns a packet transformer to transform a packet from one protocol version to another.static PacketMapping
of
(int mappedPacketId, @Nullable PacketHandler handler) static PacketMapping
of
(@Nullable PacketType mappedPacketType, @Nullable PacketHandler handler)
-
Method Details
-
applyType
Applies the changed packet type or id to the given packet wrapper.- Parameters:
wrapper
- packet wrapper
-
handler
@Nullable PacketHandler handler()Returns a packet transformer to transform a packet from one protocol version to another.- Returns:
- packet transformer, or null if no action has to be taken
-
appendHandler
Appends a packet transformer to the current packet transformer.- Parameters:
handler
- packet transformer
-
of
-
of
-