Package org.geysermc.geyser.api.network
Interface PacketChannel
- All Superinterfaces:
NetworkChannel
- All Known Subinterfaces:
RawPacketChannel
Represents a channel for network communication associated with a packet.
This channel is used for listening to communication over packets between the server and client and can be used to send or receive packets.
When the message type is the actual packet class (i.e., a Cloudburst Bedrock
packet or an MCProtocolLib Java packet), Geyser can derive the packet ID
from the class itself, so no ID is required here. For channels that operate
on raw buffers via Message.Packet
implementations, use RawPacketChannel instead, which requires the
packet ID to be explicitly set.
- Since:
- 2.9.2
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic PacketChannelCreates a new BedrockPacketChannelkeyed by the given packet class.static PacketChannelCreates a new JavaPacketChannelkeyed by the given packet class.Methods inherited from interface org.geysermc.geyser.api.network.NetworkChannel
identifier, isPacket
-
Method Details
-
bedrock
Creates a new BedrockPacketChannelkeyed by the given packet class.- Parameters:
extension- the extension creating the channelpacketType- the packet class this channel handles- Returns:
- a new Bedrock packet channel
-
java
Creates a new JavaPacketChannelkeyed by the given packet class.- Parameters:
extension- the extension creating the channelpacketType- the packet class this channel handles- Returns:
- a new Java packet channel
-