net.minecraft.network.codec

public class EnumPacketCodec<T extends Enum<T>>

implements PacketCodec<io.netty.buffer.ByteBuf, T>

net.minecraft.network.codec.EnumStreamCodec
net.minecraft.class_1_1686
net.minecraft.network.codec.EnumPacketCodec

Field summary

Modifier and TypeField
private final IntFunction<T>
byId
field_1_10583
fromId
private final PacketCodec<io.netty.buffer.ByteBuf, T>
delegate
field_1_10584
delegate

Constructor summary

ModifierConstructor
private (IntFunction<T> fromId, PacketCodec<io.netty.buffer.ByteBuf, T> delegate)

Method summary

Modifier and TypeMethod
public static <T extends Enum<T>> EnumPacketCodec<T>
custom(ToIntFunction<T> toId, IntFunction<T> byId)
method_1_10601(ToIntFunction<T> arg0, IntFunction<T> arg1)
of(ToIntFunction<T> toId, IntFunction<T> fromId)
public static <T extends Enum<T>> EnumPacketCodec<T>
continuous(Class<T> enumClass, ToIntFunction<T> toId, ByIdMap$OutOfBoundsStrategy strategy)
method_1_10600(Class<T> arg0, ToIntFunction<T> arg1, class_7995$class_7996 arg2)
of(Class<T> clazz, ToIntFunction<T> toId, ValueLists$OutOfBoundsHandling outOfBoundsHandling)
public static <T extends Enum<T>> EnumPacketCodec<T>
sparse(Class<T> enumClass, ToIntFunction<T> toId, T defaultEntry)
method_1_10604(Class<T> arg0, ToIntFunction<T> arg1, T arg2)
of(Class<T> clazz, ToIntFunction<T> toId, T fallback)
public T
decode(io.netty.buffer.ByteBuf input)
method_1_10602(io.netty.buffer.ByteBuf arg0)
decode(io.netty.buffer.ByteBuf arg0)
public void
encode(io.netty.buffer.ByteBuf output, T value)
method_1_10603(io.netty.buffer.ByteBuf arg0, T arg1)
encode(io.netty.buffer.ByteBuf arg0, T arg1)
public T
byId(int id)
method_1_10599(int arg0)
byId(int id)
public void
encode(Object output, Object value)
method_1_82(Object arg0, Object arg1)
encode(Object arg0, Object arg1)
public Object
decode(Object input)
method_1_81(Object arg0)
decode(Object arg0)