Class WrappedCodecPacket

  • All Implemented Interfaces:
    net.minecraft.network.protocol.common.custom.CustomPacketPayload

    
    public abstract class WrappedCodecPacket<P extends WrappedCodecPacket<P, T>, T extends Object>
    extends CodecPacket<P, Wrapped<T>>
                        

    A type of CodecPacket specifically designed for primitives that aren't serialized as NBT Compounds.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final ResourceLocation id
      private final CustomPacketPayload.Type<P> packetType
      private Wrapped<T> data
      private final Codec<Wrapped<T>> codec
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final P of(T data) Instantiate this packet for some data.
      Unit handle(Wrapped<T> data, IPayloadContext cx)
      abstract Unit handleUnwrapped(T data, IPayloadContext cx) The packet handler.
      • Methods inherited from class dev.wendigodrip.thebrokenscript.api.network.CodecPacket

        factory, getCodec, getData, getId, getPacketType, handle, of, read, setData, type, write
      • Methods inherited from class net.minecraft.network.protocol.common.custom.CustomPacketPayload

        toVanillaClientbound, toVanillaServerbound
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WrappedCodecPacket

        WrappedCodecPacket(Codec<T> codec)
    • Method Detail

      • of

         final P of(T data)

        Instantiate this packet for some data.