Interface RawPacketChannel

All Superinterfaces:
NetworkChannel, PacketChannel

public interface RawPacketChannel extends 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 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 Bedrock PacketChannel for the given packet ID and message type.
      Parameters:
      extension - the extension creating the channel
      packetId - the packet ID
      messageType - 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 Java PacketChannel for the given packet ID and message type.
      Parameters:
      extension - the extension creating the channel
      packetId - the packet ID
      messageType - the type of the message sent over this channel
      Returns:
      a new raw Java packet channel