Class PacketCodecDispatcher<B extends ByteBuf,V,T>

java.lang.Object
net.minecraft.network.handler.PacketCodecDispatcher<B,V,T>
All Implemented Interfaces:
PacketCodec<B,V>, PacketDecoder<B,V>, PacketEncoder<B,V>

public class PacketCodecDispatcher<B extends ByteBuf,V,T> extends Object implements PacketCodec<B,V>
Mappings:
Namespace Name
named net/minecraft/network/handler/PacketCodecDispatcher
intermediary net/minecraft/class_9136
official yr
  • Field Details

    • UNKNOWN_PACKET_INDEX

      private static final int UNKNOWN_PACKET_INDEX
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named UNKNOWN_PACKET_INDEX Lnet/minecraft/network/handler/PacketCodecDispatcher;UNKNOWN_PACKET_INDEX:I
      intermediary field_48576 Lnet/minecraft/class_9136;field_48576:I
      official a Lyr;a:I
    • packetIdGetter

      private final Function<V,? extends T> packetIdGetter
      Mappings:
      Namespace Name Mixin selector
      named packetIdGetter Lnet/minecraft/network/handler/PacketCodecDispatcher;packetIdGetter:Ljava/util/function/Function;
      intermediary field_48577 Lnet/minecraft/class_9136;field_48577:Ljava/util/function/Function;
      official b Lyr;b:Ljava/util/function/Function;
    • packetTypes

      private final List<PacketCodecDispatcher.PacketType<B extends ByteBuf,V,T>> packetTypes
      Mappings:
      Namespace Name Mixin selector
      named packetTypes Lnet/minecraft/network/handler/PacketCodecDispatcher;packetTypes:Ljava/util/List;
      intermediary field_48578 Lnet/minecraft/class_9136;field_48578:Ljava/util/List;
      official c Lyr;c:Ljava/util/List;
    • typeToIndex

      private final Object2IntMap<T> typeToIndex
      Mappings:
      Namespace Name Mixin selector
      named typeToIndex Lnet/minecraft/network/handler/PacketCodecDispatcher;typeToIndex:Lit/unimi/dsi/fastutil/objects/Object2IntMap;
      intermediary field_48579 Lnet/minecraft/class_9136;field_48579:Lit/unimi/dsi/fastutil/objects/Object2IntMap;
      official d Lyr;d:Lit/unimi/dsi/fastutil/objects/Object2IntMap;
  • Constructor Details

    • PacketCodecDispatcher

      PacketCodecDispatcher(Function<V,? extends T> packetIdGetter, List<PacketCodecDispatcher.PacketType<B,V,T>> packetTypes, Object2IntMap<T> typeToIndex)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/network/handler/PacketCodecDispatcher;<init>(Ljava/util/function/Function;Ljava/util/List;Lit/unimi/dsi/fastutil/objects/Object2IntMap;)V
      intermediary <init> Lnet/minecraft/class_9136;<init>(Ljava/util/function/Function;Ljava/util/List;Lit/unimi/dsi/fastutil/objects/Object2IntMap;)V
      official <init> Lyr;<init>(Ljava/util/function/Function;Ljava/util/List;Lit/unimi/dsi/fastutil/objects/Object2IntMap;)V
  • Method Details

    • decode

      public V decode(B b)
      Specified by:
      decode in interface PacketDecoder<B extends ByteBuf,V>
      Mappings:
      Namespace Name Mixin selector
      named decode Lnet/minecraft/network/handler/PacketCodecDispatcher;decode(Lio/netty/buffer/ByteBuf;)Ljava/lang/Object;
      intermediary method_56425 Lnet/minecraft/class_9136;method_56425(Lio/netty/buffer/ByteBuf;)Ljava/lang/Object;
      official a Lyr;a(Lio/netty/buffer/ByteBuf;)Ljava/lang/Object;
    • encode

      public void encode(B b, V v)
      Specified by:
      encode in interface PacketEncoder<B extends ByteBuf,V>
      Mappings:
      Namespace Name Mixin selector
      named encode Lnet/minecraft/network/handler/PacketCodecDispatcher;encode(Lio/netty/buffer/ByteBuf;Ljava/lang/Object;)V
      intermediary method_56426 Lnet/minecraft/class_9136;method_56426(Lio/netty/buffer/ByteBuf;Ljava/lang/Object;)V
      official a Lyr;a(Lio/netty/buffer/ByteBuf;Ljava/lang/Object;)V
    • builder

      public static <B extends ByteBuf, V, T> PacketCodecDispatcher.Builder<B,V,T> builder(Function<V,? extends T> packetIdGetter)
      Mappings:
      Namespace Name Mixin selector
      named builder Lnet/minecraft/network/handler/PacketCodecDispatcher;builder(Ljava/util/function/Function;)Lnet/minecraft/network/handler/PacketCodecDispatcher$Builder;
      intermediary method_56427 Lnet/minecraft/class_9136;method_56427(Ljava/util/function/Function;)Lnet/minecraft/class_9136$class_9137;
      official a Lyr;a(Ljava/util/function/Function;)Lyr$a;