Package com.petrolpark.util
Class CodecHelper
java.lang.Object
com.petrolpark.util.CodecHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends io.netty.buffer.ByteBuf,S extends Enum<S>>
net.minecraft.network.codec.StreamCodec<T, S> enumStream(Class<S> clazz) static <OBJECT> com.mojang.serialization.Codec<List<OBJECT>> listOrSingle(com.mojang.serialization.Codec<OBJECT> codec) static <B extends io.netty.buffer.ByteBuf,V>
net.minecraft.network.codec.StreamCodec<B, List<V>> listStream(net.minecraft.network.codec.StreamCodec<B, V> base) static <OBJECT,FIELD>
com.mojang.serialization.Codec<OBJECT> singleField(com.mojang.serialization.Codec<FIELD> fieldCodec, String fieldName, Function<OBJECT, FIELD> getter, Function<FIELD, OBJECT> constructor) static <OBJECT,FIELD>
com.mojang.serialization.MapCodec<OBJECT> singleFieldMap(com.mojang.serialization.Codec<FIELD> fieldCodec, String fieldName, Function<OBJECT, FIELD> getter, Function<FIELD, OBJECT> constructor)
-
Constructor Details
-
CodecHelper
public CodecHelper()
-
-
Method Details
-
singleField
-
singleFieldMap
-
listOrSingle
public static <OBJECT> com.mojang.serialization.Codec<List<OBJECT>> listOrSingle(com.mojang.serialization.Codec<OBJECT> codec) -
enumStream
-
listStream
public static <B extends io.netty.buffer.ByteBuf,V> net.minecraft.network.codec.StreamCodec<B,List<V>> listStream(net.minecraft.network.codec.StreamCodec<B, V> base)
-