Class DelayedPacketRegistrationHandler

java.lang.Object
commonnetwork.networking.DelayedPacketRegistrationHandler
All Implemented Interfaces:
PacketRegistrar

public class DelayedPacketRegistrationHandler extends Object implements PacketRegistrar
  • Constructor Details

    • DelayedPacketRegistrationHandler

      public DelayedPacketRegistrationHandler()
  • Method Details

    • getSide

      public Side getSide()
      Specified by:
      getSide in interface PacketRegistrar
      Returns:
      the side
    • registerPacket

      public <T> PacketRegistrar registerPacket(net.minecraft.resources.Identifier id, Class<T> packetClass, BiConsumer<T,net.minecraft.network.FriendlyByteBuf> encoder, Function<net.minecraft.network.FriendlyByteBuf,T> decoder, Consumer<PacketContext<T>> handler)
      Description copied from interface: PacketRegistrar
      Packet Registration registers a PLAY packet
      Specified by:
      registerPacket in interface PacketRegistrar
      Type Parameters:
      T - - The class type
      Parameters:
      id - - The unique Identifier packet id.
      packetClass - - The class of the packet.
      encoder - - The encoder method.
      decoder - - The decoder method.
      handler - - The handler method.
      Returns:
      The registrar for chaining registrations.
    • registerPacket

      public <T> PacketRegistrar registerPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<? extends net.minecraft.network.protocol.common.custom.CustomPacketPayload> type, Class<T> packetClass, net.minecraft.network.codec.StreamCodec<? extends net.minecraft.network.FriendlyByteBuf,T> codec, Consumer<PacketContext<T>> handler)
      Description copied from interface: PacketRegistrar
      Packet Registration, registers a PLAY packet
      Specified by:
      registerPacket in interface PacketRegistrar
      Type Parameters:
      T - - The class type
      Parameters:
      type - - The packet type.
      packetClass - - The class of the packet.
      codec - - The StreamCodec.
      handler - - The handler method.
      Returns:
      The registrar for chaining registrations.
    • registerConfigurationPacket

      public <T> PacketRegistrar registerConfigurationPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<? extends net.minecraft.network.protocol.common.custom.CustomPacketPayload> type, Class<T> packetClass, net.minecraft.network.codec.StreamCodec<? extends net.minecraft.network.FriendlyByteBuf,T> codec, Consumer<PacketContext<T>> handler)
      Description copied from interface: PacketRegistrar
      Packet Registration, registers a CONFIGURATION packet
      Specified by:
      registerConfigurationPacket in interface PacketRegistrar
      Type Parameters:
      T - - The class type
      Parameters:
      type - - The packet type.
      packetClass - - The class of the packet.
      codec - - The StreamCodec.
      handler - - The handler method.
      Returns:
      The registrar for chaining registrations.
    • registerQueuedPackets

      public void registerQueuedPackets(PacketRegistrationHandler packetRegistration)