Package org.geysermc.geyser.api.network
Interface RawPacketChannel
- All Superinterfaces:
NetworkChannel,PacketChannel
A
PacketChannel that operates on raw packet buffers rather than
a strongly typed packet class.
Use this when the message type does not correspond to an existing packet
implementation (i.e., a custom Message.Packet), in which case Geyser
cannot infer the packet ID from the class itself, and it must be supplied
explicitly.
- Since:
- 2.9.2
-
Method Summary
Modifier and TypeMethodDescriptionstatic RawPacketChannelbedrock(Extension extension, @org.checkerframework.checker.index.qual.NonNegative int packetId, Class<? extends Message.Packet> messageType) Creates a new raw BedrockPacketChannelfor the given packet ID and message type.static RawPacketChanneljava(Extension extension, @org.checkerframework.checker.index.qual.NonNegative int packetId, Class<? extends Message.Packet> messageType) Creates a new raw JavaPacketChannelfor the given packet ID and message type.@org.checkerframework.checker.index.qual.NonNegative intpacketId()Gets the packet ID associated with this channel.Methods inherited from interface org.geysermc.geyser.api.network.NetworkChannel
identifier, isPacket
-
Method Details
-
packetId
@org.checkerframework.checker.index.qual.NonNegative int packetId()Gets the packet ID associated with this channel.- Returns:
- the packet ID
-
bedrock
static RawPacketChannel bedrock(Extension extension, @org.checkerframework.checker.index.qual.NonNegative int packetId, Class<? extends Message.Packet> messageType) Creates a new raw BedrockPacketChannelfor the given packet ID and message type.- Parameters:
extension- the extension creating the channelpacketId- the packet IDmessageType- the type of the message sent over this channel- Returns:
- a new raw Bedrock packet channel
-
java
static RawPacketChannel java(Extension extension, @org.checkerframework.checker.index.qual.NonNegative int packetId, Class<? extends Message.Packet> messageType) Creates a new raw JavaPacketChannelfor the given packet ID and message type.- Parameters:
extension- the extension creating the channelpacketId- the packet IDmessageType- the type of the message sent over this channel- Returns:
- a new raw Java packet channel
-