Package org.geysermc.geyser.api.network
Interface PacketChannel
- All Superinterfaces:
NetworkChannel
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.
- Since:
- 2.9.2
-
Method Summary
Modifier and TypeMethodDescriptionstatic PacketChannelbedrock(Extension extension, @org.checkerframework.checker.index.qual.NonNegative int packetId, Class<?> packetType) Creates a new Bedrock packetNetworkChannelinstance for a packet channel.static PacketChanneljava(Extension extension, @org.checkerframework.checker.index.qual.NonNegative int packetId, Class<?> packetType) Creates a new Java packetNetworkChannelinstance for a packet channel.@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 PacketChannel bedrock(Extension extension, @org.checkerframework.checker.index.qual.NonNegative int packetId, Class<?> packetType) Creates a new Bedrock packetNetworkChannelinstance for a packet channel.- Parameters:
extension- the extension creating the channelpacketId- the packet IDpacketType- the type of the packet- Returns:
- a new packet
NetworkChannelinstance for a packet channel
-
java
static PacketChannel java(Extension extension, @org.checkerframework.checker.index.qual.NonNegative int packetId, Class<?> packetType) Creates a new Java packetNetworkChannelinstance for a packet channel.- Parameters:
extension- the extension creating the channelpacketId- the packet IDpacketType- the type of the packet- Returns:
- a new packet
NetworkChannelinstance for a packet channel
-