net.minecraft.network.codec

public interface PacketCodecs

net.minecraft.network.codec.ByteBufCodecs
net.minecraft.class_9135
net.minecraft.network.codec.PacketCodecs

Field summary

Modifier and TypeField
int
MAX_INITIAL_COLLECTION_SIZE
field_49674
MAX_COLLECTION_SIZE
PacketCodec<io.netty.buffer.ByteBuf, Boolean>
BOOL
field_48547
BOOLEAN
PacketCodec<io.netty.buffer.ByteBuf, Byte>
BYTE
field_48548
BYTE
PacketCodec<io.netty.buffer.ByteBuf, Float>
ROTATION_BYTE
field_54033
DEGREES
PacketCodec<io.netty.buffer.ByteBuf, Short>
SHORT
field_48549
SHORT
PacketCodec<io.netty.buffer.ByteBuf, Integer>
UNSIGNED_SHORT
field_51470
UNSIGNED_SHORT
PacketCodec<io.netty.buffer.ByteBuf, Integer>
INT
field_49675
INTEGER
PacketCodec<io.netty.buffer.ByteBuf, Integer>
VAR_INT
field_48550
VAR_INT
PacketCodec<io.netty.buffer.ByteBuf, OptionalInt>
OPTIONAL_VAR_INT
field_54890
OPTIONAL_INT
PacketCodec<io.netty.buffer.ByteBuf, Long>
LONG
field_54505
LONG
PacketCodec<io.netty.buffer.ByteBuf, Long>
VAR_LONG
field_48551
VAR_LONG
PacketCodec<io.netty.buffer.ByteBuf, Float>
FLOAT
field_48552
FLOAT
PacketCodec<io.netty.buffer.ByteBuf, Double>
DOUBLE
field_48553
DOUBLE
PacketCodec<io.netty.buffer.ByteBuf, byte[]>
BYTE_ARRAY
field_48987
BYTE_ARRAY
PacketCodec<io.netty.buffer.ByteBuf, long[]>
LONG_ARRAY
field_57046
LONG_ARRAY
PacketCodec<io.netty.buffer.ByteBuf, String>
STRING_UTF8
field_48554
STRING
PacketCodec<io.netty.buffer.ByteBuf, NbtElement>
TAG
field_48555
NBT_ELEMENT
PacketCodec<io.netty.buffer.ByteBuf, NbtElement>
TRUSTED_TAG
field_49676
UNLIMITED_NBT_ELEMENT
PacketCodec<io.netty.buffer.ByteBuf, NbtCompound>
COMPOUND_TAG
field_48556
NBT_COMPOUND
PacketCodec<io.netty.buffer.ByteBuf, NbtCompound>
TRUSTED_COMPOUND_TAG
field_49677
UNLIMITED_NBT_COMPOUND
PacketCodec<io.netty.buffer.ByteBuf, Optional<NbtCompound>>
OPTIONAL_COMPOUND_TAG
field_48557
OPTIONAL_NBT
PacketCodec<io.netty.buffer.ByteBuf, org.joml.Vector3fc>
VECTOR3F
field_48558
VECTOR_3F
PacketCodec<io.netty.buffer.ByteBuf, org.joml.Quaternionfc>
QUATERNIONF
field_48559
QUATERNION_F
PacketCodec<io.netty.buffer.ByteBuf, Integer>
CONTAINER_ID
field_53740
SYNC_ID
PacketCodec<io.netty.buffer.ByteBuf, com.mojang.authlib.properties.PropertyMap>
GAME_PROFILE_PROPERTIES
field_49678
PROPERTY_MAP
PacketCodec<io.netty.buffer.ByteBuf, String>
PLAYER_NAME
field_62276
PLAYER_NAME
PacketCodec<io.netty.buffer.ByteBuf, com.mojang.authlib.GameProfile>
GAME_PROFILE
field_49679
GAME_PROFILE
PacketCodec<io.netty.buffer.ByteBuf, Integer>
RGB_COLOR
field_59990
RGB

Method summary

Modifier and TypeMethod
static PacketCodec<io.netty.buffer.ByteBuf, byte[]>
byteArray(int maxSize)
method_56895(int arg0)
byteArray(int maxLength)
static PacketCodec<io.netty.buffer.ByteBuf, String>
stringUtf8(int maxStringLength)
method_56364(int arg0)
string(int maxLength)
static PacketCodec<io.netty.buffer.ByteBuf, Optional<NbtElement>>
optionalTagCodec(Supplier<NbtAccounter> accounter)
method_72185(Supplier<class_2505> arg0)
nbtElement(Supplier<NbtSizeTracker> sizeTrackerSupplier)
static PacketCodec<io.netty.buffer.ByteBuf, NbtElement>
tagCodec(Supplier<NbtAccounter> accounter)
method_56378(Supplier<class_2505> arg0)
nbt(Supplier<NbtSizeTracker> sizeTracker)
static PacketCodec<io.netty.buffer.ByteBuf, NbtCompound>
compoundTagCodec(Supplier<NbtAccounter> accounter)
method_57998(Supplier<class_2505> arg0)
nbtCompound(Supplier<NbtSizeTracker> sizeTracker)
static <T> PacketCodec<io.netty.buffer.ByteBuf, T>
fromCodecTrusted(com.mojang.serialization.Codec<T> codec)
method_57987(com.mojang.serialization.Codec<T> arg0)
unlimitedCodec(com.mojang.serialization.Codec<T> codec)
static <T> PacketCodec<io.netty.buffer.ByteBuf, T>
fromCodec(com.mojang.serialization.Codec<T> codec)
method_56368(com.mojang.serialization.Codec<T> arg0)
codec(com.mojang.serialization.Codec<T> codec)
static <T, B extends io.netty.buffer.ByteBuf, V> PacketCodec$ResultFunction<B, T, V>
fromCodec(com.mojang.serialization.DynamicOps<T> ops, com.mojang.serialization.Codec<V> codec)
method_71571(com.mojang.serialization.DynamicOps<T> arg0, com.mojang.serialization.Codec<V> arg1)
fromCodec(com.mojang.serialization.DynamicOps<T> ops, com.mojang.serialization.Codec<V> codec)
static <T> PacketCodec<io.netty.buffer.ByteBuf, T>
fromCodec(com.mojang.serialization.Codec<T> codec, Supplier<NbtAccounter> accounter)
method_57988(com.mojang.serialization.Codec<T> arg0, Supplier<class_2505> arg1)
codec(com.mojang.serialization.Codec<T> codec, Supplier<NbtSizeTracker> sizeTracker)
static <T> PacketCodec<RegistryByteBuf, T>
fromCodecWithRegistriesTrusted(com.mojang.serialization.Codec<T> codec)
method_58002(com.mojang.serialization.Codec<T> arg0)
unlimitedRegistryCodec(com.mojang.serialization.Codec<T> codec)
static <T> PacketCodec<RegistryByteBuf, T>
fromCodecWithRegistries(com.mojang.serialization.Codec<T> codec)
method_56896(com.mojang.serialization.Codec<T> arg0)
registryCodec(com.mojang.serialization.Codec<T> codec)
static <T> PacketCodec<RegistryByteBuf, T>
fromCodecWithRegistries(com.mojang.serialization.Codec<T> codec, Supplier<NbtAccounter> accounter)
method_57997(com.mojang.serialization.Codec<T> arg0, Supplier<class_2505> arg1)
registryCodec(com.mojang.serialization.Codec<T> codec, Supplier<NbtSizeTracker> sizeTracker)
static <B extends io.netty.buffer.ByteBuf, V> PacketCodec<B, Optional<V>>
optional(StreamCodec<? super B, V> original)
method_56382(class_9139<? super B, V> arg0)
optional(PacketCodec<? super B, V> codec)
static int
readCount(io.netty.buffer.ByteBuf input, int maxSize)
method_57989(io.netty.buffer.ByteBuf arg0, int arg1)
readCollectionSize(io.netty.buffer.ByteBuf buf, int maxSize)
static void
writeCount(io.netty.buffer.ByteBuf output, int count, int maxSize)
method_57990(io.netty.buffer.ByteBuf arg0, int arg1, int arg2)
writeCollectionSize(io.netty.buffer.ByteBuf buf, int size, int maxSize)
static <B extends io.netty.buffer.ByteBuf, V, C extends Collection<V>> PacketCodec<B, C>
collection(IntFunction<C> constructor, StreamCodec<? super B, V> elementCodec)
method_56376(IntFunction<C> arg0, class_9139<? super B, V> arg1)
collection(IntFunction<C> factory, PacketCodec<? super B, V> elementCodec)
static <B extends io.netty.buffer.ByteBuf, V, C extends Collection<V>> PacketCodec<B, C>
collection(IntFunction<C> constructor, StreamCodec<? super B, V> elementCodec, int maxSize)
method_57991(IntFunction<C> arg0, class_9139<? super B, V> arg1, int arg2)
collection(IntFunction<C> factory, PacketCodec<? super B, V> elementCodec, int maxSize)
static <B extends io.netty.buffer.ByteBuf, V, C extends Collection<V>> PacketCodec$ResultFunction<B, V, C>
collection(IntFunction<C> constructor)
method_56374(IntFunction<C> arg0)
toCollection(IntFunction<C> collectionFactory)
static <B extends io.netty.buffer.ByteBuf, V, C extends Collection<V>> PacketCodec$ResultFunction<B, V, C>
collection(IntFunction<C> constructor, int maxSize)
method_1_6418(IntFunction<C> arg0, int arg1)
method_1_6418(IntFunction<C> arg0, int arg1)
static <B extends io.netty.buffer.ByteBuf, V> PacketCodec$ResultFunction<B, V, List<V>>
list()
method_56363()
toList()
static <B extends io.netty.buffer.ByteBuf, V> PacketCodec$ResultFunction<B, V, List<V>>
list(int maxSize)
method_58000(int arg0)
toList(int maxLength)
static <B extends io.netty.buffer.ByteBuf, K, V, M extends Map<K, V>> PacketCodec<B, M>
map(IntFunction<? extends M> constructor, StreamCodec<? super B, K> keyCodec, StreamCodec<? super B, V> valueCodec)
method_56377(IntFunction<? extends M> arg0, class_9139<? super B, K> arg1, class_9139<? super B, V> arg2)
map(IntFunction<? extends M> factory, PacketCodec<? super B, K> keyCodec, PacketCodec<? super B, V> valueCodec)
static <B extends io.netty.buffer.ByteBuf, K, V, M extends Map<K, V>> PacketCodec<B, M>
map(IntFunction<? extends M> constructor, StreamCodec<? super B, K> keyCodec, StreamCodec<? super B, V> valueCodec, int maxSize)
method_57992(IntFunction<? extends M> arg0, class_9139<? super B, K> arg1, class_9139<? super B, V> arg2, int arg3)
map(IntFunction<? extends M> factory, PacketCodec<? super B, K> keyCodec, PacketCodec<? super B, V> valueCodec, int maxSize)
static <B extends io.netty.buffer.ByteBuf, L, R> PacketCodec<B, com.mojang.datafixers.util.Either<L, R>>
either(StreamCodec<? super B, L> leftCodec, StreamCodec<? super B, R> rightCodec)
method_57995(class_9139<? super B, L> arg0, class_9139<? super B, R> arg1)
either(PacketCodec<? super B, L> left, PacketCodec<? super B, R> right)
static <B extends io.netty.buffer.ByteBuf, V> PacketCodec$ResultFunction<B, V, V>
lengthPrefixed(int maxSize, BiFunction<B, io.netty.buffer.ByteBuf, B> decorator)
method_68861(int arg0, BiFunction<B, io.netty.buffer.ByteBuf, B> arg1)
lengthPrepended(int maxSize, BiFunction<B, io.netty.buffer.ByteBuf, B> bufWrapper)
static <V> PacketCodec$ResultFunction<io.netty.buffer.ByteBuf, V, V>
lengthPrefixed(int maxSize)
method_68864(int arg0)
lengthPrepended(int maxSize)
static <V> PacketCodec$ResultFunction<RegistryByteBuf, V, V>
registryFriendlyLengthPrefixed(int maxSize)
method_72187(int arg0)
lengthPrependedRegistry(int maxSize)
static <T> PacketCodec<io.netty.buffer.ByteBuf, T>
idMapper(IntFunction<T> byId, ToIntFunction<T> toId)
method_56375(IntFunction<T> arg0, ToIntFunction<T> arg1)
indexed(IntFunction<T> indexToValue, ToIntFunction<T> valueToIndex)
static <T> PacketCodec<io.netty.buffer.ByteBuf, T>
idMapper(IdMap<T> mapper)
method_56371(class_2359<T> arg0)
entryOf(IndexedIterable<T> iterable)
private static <T, R> PacketCodec<RegistryByteBuf, R>
registry(ResourceKey<? extends Registry<T>> registryKey, Function<Registry<T>, IdMap<R>> mapExtractor)
method_56366(class_5321<? extends class_2378<T>> arg0, Function<class_2378<T>, class_2359<R>> arg1)
registry(RegistryKey<? extends Registry<T>> registry, Function<Registry<T>, IndexedIterable<R>> registryTransformer)
static <T> PacketCodec<RegistryByteBuf, T>
registry(ResourceKey<? extends Registry<T>> registryKey)
method_56365(class_5321<? extends class_2378<T>> arg0)
registryValue(RegistryKey<? extends Registry<T>> registry)
static <T> PacketCodec<RegistryByteBuf, RegistryEntry<T>>
holderRegistry(ResourceKey<? extends Registry<T>> registryKey)
method_56383(class_5321<? extends class_2378<T>> arg0)
registryEntry(RegistryKey<? extends Registry<T>> registry)
static <T> PacketCodec<RegistryByteBuf, RegistryEntry<T>>
holder(ResourceKey<? extends Registry<T>> registryKey, StreamCodec<? super RegistryFriendlyByteBuf, T> directCodec)
method_56367(class_5321<? extends class_2378<T>> arg0, class_9139<? super class_9129, T> arg1)
registryEntry(RegistryKey<? extends Registry<T>> registry, PacketCodec<? super RegistryByteBuf, T> directCodec)
static <T> PacketCodec<RegistryByteBuf, RegistryEntryList<T>>
holderSet(ResourceKey<? extends Registry<T>> registryKey)
method_58001(class_5321<? extends class_2378<T>> arg0)
registryEntryList(RegistryKey<? extends Registry<T>> registryRef)
static PacketCodec<io.netty.buffer.ByteBuf, com.google.gson.JsonElement>
lenientJson(int maxStringLength)
method_71572(int arg0)
lenientJson(int maxLength)
private static IndexedIterable
lambda$registry$0(Registry arg0)
method_56372(class_2378 arg0)
method_56372(Registry registry)
private static RegistryByteBuf
lambda$registryFriendlyLengthPrefixed$0(RegistryFriendlyByteBuf arg0, io.netty.buffer.ByteBuf arg1)
method_72186(class_9129 arg0, io.netty.buffer.ByteBuf arg1)
method_72186(RegistryByteBuf arg0, io.netty.buffer.ByteBuf arg1)
private static io.netty.buffer.ByteBuf
lambda$lengthPrefixed$1(io.netty.buffer.ByteBuf arg0, io.netty.buffer.ByteBuf arg1)
method_68863(io.netty.buffer.ByteBuf arg0, io.netty.buffer.ByteBuf arg1)
method_68863(io.netty.buffer.ByteBuf arg0, io.netty.buffer.ByteBuf bufToWrap)
private static PacketCodec
lambda$lengthPrefixed$0(int arg0, BiFunction arg1, StreamCodec arg2)
method_68862(int arg0, BiFunction arg1, class_9139 arg2)
method_68862(int arg0, BiFunction arg1, PacketCodec codec)
private static PacketCodec
lambda$list$1(int arg0, StreamCodec arg1)
method_57986(int arg0, class_9139 arg1)
method_57986(int arg0, PacketCodec codec)
private static PacketCodec
lambda$list$0(StreamCodec arg0)
method_56385(class_9139 arg0)
method_56385(PacketCodec codec)
private static PacketCodec
lambda$collection$1(IntFunction arg0, int arg1, StreamCodec arg2)
method_1_6419(IntFunction arg0, int arg1, class_9139 arg2)
method_1_6419(IntFunction arg0, int arg1, PacketCodec arg2)
private static PacketCodec
lambda$collection$0(IntFunction arg0, StreamCodec arg1)
method_56384(IntFunction arg0, class_9139 arg1)
method_56384(IntFunction arg0, PacketCodec codec)
private static PacketCodec
lambda$fromCodec$0(com.mojang.serialization.Codec arg0, com.mojang.serialization.DynamicOps arg1, StreamCodec arg2)
method_71570(com.mojang.serialization.Codec arg0, com.mojang.serialization.DynamicOps arg1, class_9139 arg2)
method_71570(com.mojang.serialization.Codec arg0, com.mojang.serialization.DynamicOps arg1, PacketCodec codec)
private static NbtElement
lambda$compoundTagCodec$1(CompoundTag arg0)
method_57993(class_2487 arg0)
method_57993(NbtCompound nbt)
private static NbtCompound
lambda$compoundTagCodec$0(Tag arg0)
method_57994(class_2520 arg0)
method_57994(NbtElement nbt)
private static Integer
lambda$static$1(OptionalInt arg0)
method_64960(OptionalInt arg0)
method_64960(OptionalInt value)
private static OptionalInt
lambda$static$0(Integer arg0)
method_64959(Integer arg0)
method_64959(Integer value)