Package net.minecraft.network.codec
Interface ByteBufCodecs
public interface ByteBufCodecs
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StreamCodec<io.netty.buffer.ByteBuf, Boolean> static final StreamCodec<io.netty.buffer.ByteBuf, Byte> static final StreamCodec<io.netty.buffer.ByteBuf, byte[]> static final StreamCodec<io.netty.buffer.ByteBuf, CompoundTag> static final StreamCodec<io.netty.buffer.ByteBuf, Integer> static final StreamCodec<io.netty.buffer.ByteBuf, Double> static final StreamCodec<io.netty.buffer.ByteBuf, Float> static final StreamCodec<io.netty.buffer.ByteBuf, com.mojang.authlib.GameProfile> static final StreamCodec<io.netty.buffer.ByteBuf, com.mojang.authlib.properties.PropertyMap> static final StreamCodec<io.netty.buffer.ByteBuf, Integer> static final StreamCodec<io.netty.buffer.ByteBuf, Long> static final StreamCodec<io.netty.buffer.ByteBuf, long[]> static final intstatic final StreamCodec<io.netty.buffer.ByteBuf, Optional<CompoundTag>> static final StreamCodec<io.netty.buffer.ByteBuf, OptionalInt> static final StreamCodec<io.netty.buffer.ByteBuf, org.joml.Quaternionf> static final StreamCodec<io.netty.buffer.ByteBuf, Integer> static final StreamCodec<io.netty.buffer.ByteBuf, Float> static final StreamCodec<io.netty.buffer.ByteBuf, Short> static final StreamCodec<io.netty.buffer.ByteBuf, String> static final StreamCodec<io.netty.buffer.ByteBuf, Tag> static final StreamCodec<io.netty.buffer.ByteBuf, CompoundTag> static final StreamCodec<io.netty.buffer.ByteBuf, Tag> static final StreamCodec<io.netty.buffer.ByteBuf, Integer> static final StreamCodec<io.netty.buffer.ByteBuf, Integer> static final StreamCodec<io.netty.buffer.ByteBuf, Long> static final StreamCodec<io.netty.buffer.ByteBuf, org.joml.Vector3f> -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic StreamCodec<io.netty.buffer.ByteBuf, byte[]> byteArray(int pMaxSize) static <B extends io.netty.buffer.ByteBuf,V, C extends Collection<V>>
StreamCodec.CodecOperation<B, V, C> collection(IntFunction<C> pFactory) static <B extends io.netty.buffer.ByteBuf,V, C extends Collection<V>>
StreamCodec<B, C> collection(IntFunction<C> pFactory, StreamCodec<? super B, V> pCodec) static <B extends io.netty.buffer.ByteBuf,V, C extends Collection<V>>
StreamCodec<B, C> collection(IntFunction<C> pFactory, StreamCodec<? super B, V> pCodec, int pMaxSize) static StreamCodec<io.netty.buffer.ByteBuf, CompoundTag> compoundTagCodec(Supplier<NbtAccounter> pAccounterSupplier) static <B extends io.netty.buffer.ByteBuf,L, R>
StreamCodec<B, com.mojang.datafixers.util.Either<L, R>> either(StreamCodec<? super B, L> pLeftCodec, StreamCodec<? super B, R> pRightCodec) static <T> StreamCodec<io.netty.buffer.ByteBuf, T> fromCodec(com.mojang.serialization.Codec<T> pCodec) static <T> StreamCodec<io.netty.buffer.ByteBuf, T> fromCodec(com.mojang.serialization.Codec<T> pCodec, Supplier<NbtAccounter> pAccounterSupplier) static <T,B extends io.netty.buffer.ByteBuf, V>
StreamCodec.CodecOperation<B, T, V> fromCodec(com.mojang.serialization.DynamicOps<T> pOps, com.mojang.serialization.Codec<V> pCodec) static <T> StreamCodec<io.netty.buffer.ByteBuf, T> fromCodecTrusted(com.mojang.serialization.Codec<T> pCodec) static <T> StreamCodec<RegistryFriendlyByteBuf, T> fromCodecWithRegistries(com.mojang.serialization.Codec<T> pCodec) static <T> StreamCodec<RegistryFriendlyByteBuf, T> fromCodecWithRegistries(com.mojang.serialization.Codec<T> pCodec, Supplier<NbtAccounter> pAccounterSupplier) static <T> StreamCodec<RegistryFriendlyByteBuf, T> fromCodecWithRegistriesTrusted(com.mojang.serialization.Codec<T> pCodec) private static <T> Registry<T> getSyncableRegistryOrThrow(RegistryFriendlyByteBuf buffer, ResourceKey<? extends Registry<T>> registryKey) static <T> StreamCodec<RegistryFriendlyByteBuf, Holder<T>> holder(ResourceKey<? extends Registry<T>> pRegistryKey, StreamCodec<? super RegistryFriendlyByteBuf, T> pCodec) static <T> StreamCodec<RegistryFriendlyByteBuf, Holder<T>> holderRegistry(ResourceKey<? extends Registry<T>> pRegistryKey) static <T> StreamCodec<RegistryFriendlyByteBuf, HolderSet<T>> holderSet(ResourceKey<? extends Registry<T>> pRegistryKey) static <T> StreamCodec<io.netty.buffer.ByteBuf, T> idMapper(IntFunction<T> pIdLookup, ToIntFunction<T> pIdGetter) static <T> StreamCodec<io.netty.buffer.ByteBuf, T> static <V> StreamCodec.CodecOperation<io.netty.buffer.ByteBuf, V, V> lengthPrefixed(int pLength) static <B extends io.netty.buffer.ByteBuf,V>
StreamCodec.CodecOperation<B, V, V> lengthPrefixed(int pMaxLength, BiFunction<B, io.netty.buffer.ByteBuf, B> pFunction) static StreamCodec<io.netty.buffer.ByteBuf, JsonElement> lenientJson(int pMaxLength) static <B extends io.netty.buffer.ByteBuf,V>
StreamCodec.CodecOperation<B, V, List<V>> list()static <B extends io.netty.buffer.ByteBuf,V>
StreamCodec.CodecOperation<B, V, List<V>> list(int pMaxSize) static <B extends io.netty.buffer.ByteBuf,K, V, M extends Map<K, V>>
StreamCodec<B, M> map(IntFunction<? extends M> pFactory, StreamCodec<? super B, K> pKeyCodec, StreamCodec<? super B, V> pValueCodec) static <B extends io.netty.buffer.ByteBuf,K, V, M extends Map<K, V>>
StreamCodec<B, M> map(IntFunction<? extends M> pFactory, StreamCodec<? super B, K> pKeyCodec, StreamCodec<? super B, V> pValueCodec, int pMaxSize) static <B extends io.netty.buffer.ByteBuf,V>
StreamCodec<B, Optional<V>> optional(StreamCodec<B, V> pCodec) static StreamCodec<io.netty.buffer.ByteBuf, Optional<Tag>> optionalTagCodec(Supplier<NbtAccounter> pAccounter) static intreadCount(io.netty.buffer.ByteBuf pBuffer, int pMaxSize) static <T> StreamCodec<RegistryFriendlyByteBuf, T> registry(ResourceKey<? extends Registry<T>> pRegistryKey) private static <T,R> StreamCodec <RegistryFriendlyByteBuf, R> static <V> StreamCodec.CodecOperation<RegistryFriendlyByteBuf, V, V> registryFriendlyLengthPrefixed(int pLength) static StreamCodec<io.netty.buffer.ByteBuf, String> stringUtf8(int pMaxLength) static StreamCodec<io.netty.buffer.ByteBuf, Tag> tagCodec(Supplier<NbtAccounter> pAccounter) static voidwriteCount(io.netty.buffer.ByteBuf pBuffer, int pCount, int pMaxSize)
-
Field Details
-
MAX_INITIAL_COLLECTION_SIZE
static final int MAX_INITIAL_COLLECTION_SIZE- See Also:
-
BOOL
-
BYTE
-
ROTATION_BYTE
-
SHORT
-
UNSIGNED_SHORT
-
INT
-
VAR_INT
-
OPTIONAL_VAR_INT
-
LONG
-
VAR_LONG
-
FLOAT
-
DOUBLE
-
BYTE_ARRAY
-
LONG_ARRAY
-
STRING_UTF8
-
TAG
-
TRUSTED_TAG
-
COMPOUND_TAG
-
TRUSTED_COMPOUND_TAG
-
OPTIONAL_COMPOUND_TAG
-
VECTOR3F
-
QUATERNIONF
-
CONTAINER_ID
-
GAME_PROFILE_PROPERTIES
static final StreamCodec<io.netty.buffer.ByteBuf,com.mojang.authlib.properties.PropertyMap> GAME_PROFILE_PROPERTIES -
GAME_PROFILE
-
RGB_COLOR
-
-
Method Details
-
byteArray
-
stringUtf8
-
optionalTagCodec
static StreamCodec<io.netty.buffer.ByteBuf,Optional<Tag>> optionalTagCodec(Supplier<NbtAccounter> pAccounter) -
tagCodec
-
compoundTagCodec
static StreamCodec<io.netty.buffer.ByteBuf,CompoundTag> compoundTagCodec(Supplier<NbtAccounter> pAccounterSupplier) -
fromCodecTrusted
static <T> StreamCodec<io.netty.buffer.ByteBuf,T> fromCodecTrusted(com.mojang.serialization.Codec<T> pCodec) -
fromCodec
static <T> StreamCodec<io.netty.buffer.ByteBuf,T> fromCodec(com.mojang.serialization.Codec<T> pCodec) -
fromCodec
static <T,B extends io.netty.buffer.ByteBuf, StreamCodec.CodecOperation<B,V> T, fromCodecV> (com.mojang.serialization.DynamicOps<T> pOps, com.mojang.serialization.Codec<V> pCodec) -
fromCodec
static <T> StreamCodec<io.netty.buffer.ByteBuf,T> fromCodec(com.mojang.serialization.Codec<T> pCodec, Supplier<NbtAccounter> pAccounterSupplier) -
fromCodecWithRegistriesTrusted
static <T> StreamCodec<RegistryFriendlyByteBuf,T> fromCodecWithRegistriesTrusted(com.mojang.serialization.Codec<T> pCodec) -
fromCodecWithRegistries
static <T> StreamCodec<RegistryFriendlyByteBuf,T> fromCodecWithRegistries(com.mojang.serialization.Codec<T> pCodec) -
fromCodecWithRegistries
static <T> StreamCodec<RegistryFriendlyByteBuf,T> fromCodecWithRegistries(com.mojang.serialization.Codec<T> pCodec, Supplier<NbtAccounter> pAccounterSupplier) -
optional
static <B extends io.netty.buffer.ByteBuf,V> StreamCodec<B,Optional<V>> optional(StreamCodec<B, V> pCodec) -
readCount
static int readCount(io.netty.buffer.ByteBuf pBuffer, int pMaxSize) -
writeCount
static void writeCount(io.netty.buffer.ByteBuf pBuffer, int pCount, int pMaxSize) -
collection
static <B extends io.netty.buffer.ByteBuf,V, StreamCodec<B,C extends Collection<V>> C> collection(IntFunction<C> pFactory, StreamCodec<? super B, V> pCodec) -
collection
static <B extends io.netty.buffer.ByteBuf,V, StreamCodec<B,C extends Collection<V>> C> collection(IntFunction<C> pFactory, StreamCodec<? super B, V> pCodec, int pMaxSize) -
collection
static <B extends io.netty.buffer.ByteBuf,V, StreamCodec.CodecOperation<B,C extends Collection<V>> V, collectionC> (IntFunction<C> pFactory) -
list
-
list
static <B extends io.netty.buffer.ByteBuf,V> StreamCodec.CodecOperation<B,V, listList<V>> (int pMaxSize) -
map
static <B extends io.netty.buffer.ByteBuf,K, StreamCodec<B,V, M extends Map<K, V>> M> map(IntFunction<? extends M> pFactory, StreamCodec<? super B, K> pKeyCodec, StreamCodec<? super B, V> pValueCodec) -
map
static <B extends io.netty.buffer.ByteBuf,K, StreamCodec<B,V, M extends Map<K, V>> M> map(IntFunction<? extends M> pFactory, StreamCodec<? super B, K> pKeyCodec, StreamCodec<? super B, V> pValueCodec, int pMaxSize) -
either
static <B extends io.netty.buffer.ByteBuf,L, StreamCodec<B,R> com.mojang.datafixers.util.Either<L, eitherR>> (StreamCodec<? super B, L> pLeftCodec, StreamCodec<? super B, R> pRightCodec) -
lengthPrefixed
static <B extends io.netty.buffer.ByteBuf,V> StreamCodec.CodecOperation<B,V, lengthPrefixedV> (int pMaxLength, BiFunction<B, io.netty.buffer.ByteBuf, B> pFunction) -
lengthPrefixed
-
registryFriendlyLengthPrefixed
static <V> StreamCodec.CodecOperation<RegistryFriendlyByteBuf,V, registryFriendlyLengthPrefixedV> (int pLength) -
idMapper
static <T> StreamCodec<io.netty.buffer.ByteBuf,T> idMapper(IntFunction<T> pIdLookup, ToIntFunction<T> pIdGetter) -
idMapper
-
registry
private static <T,R> StreamCodec<RegistryFriendlyByteBuf,R> registry(ResourceKey<? extends Registry<T>> pRegistryKey, Function<Registry<T>, IdMap<R>> pIdGetter) -
registry
static <T> StreamCodec<RegistryFriendlyByteBuf,T> registry(ResourceKey<? extends Registry<T>> pRegistryKey) -
holderRegistry
static <T> StreamCodec<RegistryFriendlyByteBuf,Holder<T>> holderRegistry(ResourceKey<? extends Registry<T>> pRegistryKey) -
holder
static <T> StreamCodec<RegistryFriendlyByteBuf,Holder<T>> holder(ResourceKey<? extends Registry<T>> pRegistryKey, StreamCodec<? super RegistryFriendlyByteBuf, T> pCodec) -
getSyncableRegistryOrThrow
private static <T> Registry<T> getSyncableRegistryOrThrow(RegistryFriendlyByteBuf buffer, ResourceKey<? extends Registry<T>> registryKey) -
holderSet
static <T> StreamCodec<RegistryFriendlyByteBuf,HolderSet<T>> holderSet(ResourceKey<? extends Registry<T>> pRegistryKey) -
lenientJson
-