Interface PacketChannel

All Superinterfaces:
NetworkChannel

public interface PacketChannel extends 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 Type
    Method
    Description
    bedrock(Extension extension, @org.checkerframework.checker.index.qual.NonNegative int packetId, Class<?> packetType)
    Creates a new Bedrock packet NetworkChannel instance for a packet channel.
    java(Extension extension, @org.checkerframework.checker.index.qual.NonNegative int packetId, Class<?> packetType)
    Creates a new Java packet NetworkChannel instance for a packet channel.
    @org.checkerframework.checker.index.qual.NonNegative int
    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 packet NetworkChannel instance for a packet channel.
      Parameters:
      extension - the extension creating the channel
      packetId - the packet ID
      packetType - the type of the packet
      Returns:
      a new packet NetworkChannel instance for a packet channel
    • java

      static PacketChannel java(Extension extension, @org.checkerframework.checker.index.qual.NonNegative int packetId, Class<?> packetType)
      Creates a new Java packet NetworkChannel instance for a packet channel.
      Parameters:
      extension - the extension creating the channel
      packetId - the packet ID
      packetType - the type of the packet
      Returns:
      a new packet NetworkChannel instance for a packet channel