Contents
Interface IPacketHandler
- All Known Implementing Classes:
GamePacketHandler
public interface IPacketHandler
An interface that represents a handler for inbound packets.
-
Method Summary
Modifier and TypeMethodDescriptionvoidregisterHandler(int packetId, Consumer<ToServerPacket> handler) Called to register a packet handler for a specific packet.voidregisterNoOpHandlers(int... packetIds) Called to register a collection of packet IDs, without an associated consumer.
-
Method Details
-
registerHandler
Called to register a packet handler for a specific packet.- Parameters:
packetId- The unique ID of the packet to register a handler for.handler- The callback that should handle this packet.
-
registerNoOpHandlers
void registerNoOpHandlers(int... packetIds) Called to register a collection of packet IDs, without an associated consumer.- Parameters:
packetIds- The unique ID of the packet IDs to register.
-
getPlayerRef
-
getIdentifier
- Returns:
- the unique identifier of this packet handler.
-