Package org.moddingx.libx.codec
Class MoreStreamCodecs
java.lang.Object
org.moddingx.libx.codec.MoreStreamCodecs
Provides additional
stream codecs
.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlistOf
(net.minecraft.network.codec.StreamCodec<? super B, T> elementCodec) mapOf
(net.minecraft.network.codec.StreamCodec<? super B, K> keyCodec, net.minecraft.network.codec.StreamCodec<? super B, V> valueCodec) maybe
(net.minecraft.network.codec.StreamCodec<? super B, T> elementCodec) static <B extends ByteBuf,
T>
net.minecraft.network.codec.StreamCodec<B, T> Creates a unitStreamCodec
.
-
Field Details
-
TAG
Astream streamCodec
for NBT tags. -
COMPOUND_TAG
public static final net.minecraft.network.codec.StreamCodec<ByteBuf,net.minecraft.nbt.CompoundTag> COMPOUND_TAGAstream streamCodec
for NBT compound tags.
-
-
Constructor Details
-
MoreStreamCodecs
public MoreStreamCodecs()
-
-
Method Details
-
unit
public static <B extends ByteBuf,T> net.minecraft.network.codec.StreamCodec<B,T> unit(Supplier<T> value) Creates a unitStreamCodec
. The returned codec will never write any bytes and always use the providedSupplier
to produce a result value. It ignores its input while encoding. -
maybe
-
listOf
-
mapOf
-