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, String> static final StreamCodec<io.netty.buffer.ByteBuf, Quaternionfc> 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, Vector3fc> -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic StreamCodec<io.netty.buffer.ByteBuf, byte[]> byteArray(int maxSize) static <B extends io.netty.buffer.ByteBuf, V, C extends Collection<V>>
StreamCodec.CodecOperation<B, V, C> collection(IntFunction<C> constructor) static <B extends io.netty.buffer.ByteBuf, V, C extends Collection<V>>
StreamCodec<B, C> collection(IntFunction<C> constructor, StreamCodec<? super B, V> elementCodec) static <B extends io.netty.buffer.ByteBuf, V, C extends Collection<V>>
StreamCodec<B, C> collection(IntFunction<C> constructor, StreamCodec<? super B, V> elementCodec, int maxSize) static StreamCodec<io.netty.buffer.ByteBuf, CompoundTag> compoundTagCodec(Supplier<NbtAccounter> accounter) static <B extends io.netty.buffer.ByteBuf, L, R>
StreamCodec<B, com.mojang.datafixers.util.Either<L, R>> either(StreamCodec<? super B, L> leftCodec, StreamCodec<? super B, R> rightCodec) static <T> StreamCodec<io.netty.buffer.ByteBuf, T> fromCodec(com.mojang.serialization.Codec<T> codec) static <T> StreamCodec<io.netty.buffer.ByteBuf, T> fromCodec(com.mojang.serialization.Codec<T> codec, Supplier<NbtAccounter> accounter) static <T, B extends io.netty.buffer.ByteBuf, V>
StreamCodec.CodecOperation<B, T, V> fromCodec(com.mojang.serialization.DynamicOps<T> ops, com.mojang.serialization.Codec<V> codec) static <T> StreamCodec<io.netty.buffer.ByteBuf, T> fromCodecTrusted(com.mojang.serialization.Codec<T> codec) static <T> StreamCodec<RegistryFriendlyByteBuf, T> fromCodecWithRegistries(com.mojang.serialization.Codec<T> codec) static <T> StreamCodec<RegistryFriendlyByteBuf, T> fromCodecWithRegistries(com.mojang.serialization.Codec<T> codec, Supplier<NbtAccounter> accounter) static <T> StreamCodec<RegistryFriendlyByteBuf, T> fromCodecWithRegistriesTrusted(com.mojang.serialization.Codec<T> codec) private static <T> Registry<T> getSyncableRegistryOrThrow(RegistryFriendlyByteBuf buffer, ResourceKey<? extends Registry<T>> registryKey) static <T> StreamCodec<RegistryFriendlyByteBuf, Holder<T>> holder(ResourceKey<? extends Registry<T>> registryKey, StreamCodec<? super RegistryFriendlyByteBuf, T> directCodec) static <T> StreamCodec<RegistryFriendlyByteBuf, Holder<T>> holderRegistry(ResourceKey<? extends Registry<T>> registryKey) static <T> StreamCodec<RegistryFriendlyByteBuf, HolderSet<T>> holderSet(ResourceKey<? extends Registry<T>> registryKey) static <T> StreamCodec<io.netty.buffer.ByteBuf, T> idMapper(IntFunction<T> byId, ToIntFunction<T> toId) static <T> StreamCodec<io.netty.buffer.ByteBuf, T> static <V> StreamCodec.CodecOperation<io.netty.buffer.ByteBuf, V, V> lengthPrefixed(int maxSize) static <B extends io.netty.buffer.ByteBuf, V>
StreamCodec.CodecOperation<B, V, V> lengthPrefixed(int maxSize, BiFunction<B, io.netty.buffer.ByteBuf, B> decorator) static StreamCodec<io.netty.buffer.ByteBuf, JsonElement> lenientJson(int maxStringLength) 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 maxSize) static <B extends io.netty.buffer.ByteBuf, K, V, M extends Map<K,V>>
StreamCodec<B, M> map(IntFunction<? extends M> constructor, StreamCodec<? super B, K> keyCodec, StreamCodec<? super B, V> valueCodec) static <B extends io.netty.buffer.ByteBuf, K, V, M extends Map<K,V>>
StreamCodec<B, M> map(IntFunction<? extends M> constructor, StreamCodec<? super B, K> keyCodec, StreamCodec<? super B, V> valueCodec, int maxSize) static <B extends io.netty.buffer.ByteBuf, V>
StreamCodec<B, Optional<V>> optional(StreamCodec<? super B, V> original) static StreamCodec<io.netty.buffer.ByteBuf, Optional<Tag>> optionalTagCodec(Supplier<NbtAccounter> accounter) static intreadCount(io.netty.buffer.ByteBuf input, int maxSize) static <T> StreamCodec<RegistryFriendlyByteBuf, T> registry(ResourceKey<? extends Registry<T>> registryKey) private static <T,R> StreamCodec <RegistryFriendlyByteBuf, R> registry(ResourceKey<? extends Registry<T>> registryKey, Function<Registry<T>, IdMap<R>> mapExtractor) static <V> StreamCodec.CodecOperation<RegistryFriendlyByteBuf, V, V> registryFriendlyLengthPrefixed(int maxSize) static StreamCodec<io.netty.buffer.ByteBuf, String> stringUtf8(int maxStringLength) static StreamCodec<io.netty.buffer.ByteBuf, Tag> tagCodec(Supplier<NbtAccounter> accounter) static voidwriteCount(io.netty.buffer.ByteBuf output, int count, int maxSize)
-
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 -
PLAYER_NAME
-
GAME_PROFILE
-
RGB_COLOR
-
-
Method Details
-
byteArray
-
stringUtf8
-
optionalTagCodec
static StreamCodec<io.netty.buffer.ByteBuf, Optional<Tag>> optionalTagCodec(Supplier<NbtAccounter> accounter) -
tagCodec
-
compoundTagCodec
static StreamCodec<io.netty.buffer.ByteBuf, CompoundTag> compoundTagCodec(Supplier<NbtAccounter> accounter) -
fromCodecTrusted
static <T> StreamCodec<io.netty.buffer.ByteBuf, T> fromCodecTrusted(com.mojang.serialization.Codec<T> codec) -
fromCodec
static <T> StreamCodec<io.netty.buffer.ByteBuf, T> fromCodec(com.mojang.serialization.Codec<T> codec) -
fromCodec
static <T, B extends io.netty.buffer.ByteBuf, V> StreamCodec.CodecOperation<B,T, fromCodecV> (com.mojang.serialization.DynamicOps<T> ops, com.mojang.serialization.Codec<V> codec) -
fromCodec
static <T> StreamCodec<io.netty.buffer.ByteBuf, T> fromCodec(com.mojang.serialization.Codec<T> codec, Supplier<NbtAccounter> accounter) -
fromCodecWithRegistriesTrusted
static <T> StreamCodec<RegistryFriendlyByteBuf, T> fromCodecWithRegistriesTrusted(com.mojang.serialization.Codec<T> codec) -
fromCodecWithRegistries
static <T> StreamCodec<RegistryFriendlyByteBuf, T> fromCodecWithRegistries(com.mojang.serialization.Codec<T> codec) -
fromCodecWithRegistries
static <T> StreamCodec<RegistryFriendlyByteBuf, T> fromCodecWithRegistries(com.mojang.serialization.Codec<T> codec, Supplier<NbtAccounter> accounter) -
optional
static <B extends io.netty.buffer.ByteBuf, V> StreamCodec<B, Optional<V>> optional(StreamCodec<? super B, V> original) -
readCount
static int readCount(io.netty.buffer.ByteBuf input, int maxSize) -
writeCount
static void writeCount(io.netty.buffer.ByteBuf output, int count, int maxSize) -
collection
static <B extends io.netty.buffer.ByteBuf, V, C extends Collection<V>> StreamCodec<B,C> collection(IntFunction<C> constructor, StreamCodec<? super B, V> elementCodec) -
collection
static <B extends io.netty.buffer.ByteBuf, V, C extends Collection<V>> StreamCodec<B,C> collection(IntFunction<C> constructor, StreamCodec<? super B, V> elementCodec, int maxSize) -
collection
static <B extends io.netty.buffer.ByteBuf, V, C extends Collection<V>> StreamCodec.CodecOperation<B,V, collectionC> (IntFunction<C> constructor) -
list
-
list
static <B extends io.netty.buffer.ByteBuf, V> StreamCodec.CodecOperation<B,V, listList<V>> (int maxSize) -
map
static <B extends io.netty.buffer.ByteBuf, K, V, M extends Map<K,V>> StreamCodec<B,M> map(IntFunction<? extends M> constructor, StreamCodec<? super B, K> keyCodec, StreamCodec<? super B, V> valueCodec) -
map
static <B extends io.netty.buffer.ByteBuf, K, V, M extends Map<K,V>> StreamCodec<B,M> map(IntFunction<? extends M> constructor, StreamCodec<? super B, K> keyCodec, StreamCodec<? super B, V> valueCodec, int maxSize) -
either
static <B extends io.netty.buffer.ByteBuf, L, R> StreamCodec<B, com.mojang.datafixers.util.Either<L,R>> either(StreamCodec<? super B, L> leftCodec, StreamCodec<? super B, R> rightCodec) -
lengthPrefixed
static <B extends io.netty.buffer.ByteBuf, V> StreamCodec.CodecOperation<B,V, lengthPrefixedV> (int maxSize, BiFunction<B, io.netty.buffer.ByteBuf, B> decorator) -
lengthPrefixed
-
registryFriendlyLengthPrefixed
static <V> StreamCodec.CodecOperation<RegistryFriendlyByteBuf, V, V> registryFriendlyLengthPrefixed(int maxSize) -
idMapper
static <T> StreamCodec<io.netty.buffer.ByteBuf, T> idMapper(IntFunction<T> byId, ToIntFunction<T> toId) -
idMapper
-
registry
private static <T,R> StreamCodec<RegistryFriendlyByteBuf, R> registry(ResourceKey<? extends Registry<T>> registryKey, Function<Registry<T>, IdMap<R>> mapExtractor) -
registry
static <T> StreamCodec<RegistryFriendlyByteBuf, T> registry(ResourceKey<? extends Registry<T>> registryKey) -
holderRegistry
static <T> StreamCodec<RegistryFriendlyByteBuf, Holder<T>> holderRegistry(ResourceKey<? extends Registry<T>> registryKey) -
holder
static <T> StreamCodec<RegistryFriendlyByteBuf, Holder<T>> holder(ResourceKey<? extends Registry<T>> registryKey, StreamCodec<? super RegistryFriendlyByteBuf, T> directCodec) -
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>> registryKey) -
lenientJson
-