Class IdDispatchCodec<B extends io.netty.buffer.ByteBuf,V,T>

java.lang.Object
net.minecraft.network.codec.IdDispatchCodec<B,V,T>
All Implemented Interfaces:
StreamCodec<B,V>, StreamDecoder<B,V>, StreamEncoder<B,V>

public class IdDispatchCodec<B extends io.netty.buffer.ByteBuf,V,T> extends Object implements StreamCodec<B,V>
  • Field Details

    • UNKNOWN_TYPE

      private static final int UNKNOWN_TYPE
      See Also:
    • typeGetter

      private final Function<V,? extends T> typeGetter
    • byId

      private final List<IdDispatchCodec.Entry<B extends io.netty.buffer.ByteBuf,V,T>> byId
    • toId

      private final it.unimi.dsi.fastutil.objects.Object2IntMap<T> toId
  • Constructor Details

  • Method Details

    • decode

      public V decode(B p_320374_)
      Specified by:
      decode in interface StreamDecoder<B extends io.netty.buffer.ByteBuf,V>
    • encode

      public void encode(B p_319955_, V p_320138_)
      Specified by:
      encode in interface StreamEncoder<B extends io.netty.buffer.ByteBuf,V>
    • builder

      public static <B extends io.netty.buffer.ByteBuf, V, T> IdDispatchCodec.Builder<B,V,T> builder(Function<V,? extends T> p_319781_)