Interface ByteBufCodecs


public interface ByteBufCodecs
  • Field Details

    • MAX_INITIAL_COLLECTION_SIZE

      static final int MAX_INITIAL_COLLECTION_SIZE
      See Also:
    • BOOL

      static final StreamCodec<io.netty.buffer.ByteBuf,Boolean> BOOL
    • BYTE

      static final StreamCodec<io.netty.buffer.ByteBuf,Byte> BYTE
    • SHORT

      static final StreamCodec<io.netty.buffer.ByteBuf,Short> SHORT
    • INT

      static final StreamCodec<io.netty.buffer.ByteBuf,Integer> INT
    • VAR_INT

      static final StreamCodec<io.netty.buffer.ByteBuf,Integer> VAR_INT
    • VAR_LONG

      static final StreamCodec<io.netty.buffer.ByteBuf,Long> VAR_LONG
    • FLOAT

      static final StreamCodec<io.netty.buffer.ByteBuf,Float> FLOAT
    • DOUBLE

      static final StreamCodec<io.netty.buffer.ByteBuf,Double> DOUBLE
    • BYTE_ARRAY

      static final StreamCodec<io.netty.buffer.ByteBuf,byte[]> BYTE_ARRAY
    • STRING_UTF8

      static final StreamCodec<io.netty.buffer.ByteBuf,String> STRING_UTF8
    • TAG

      static final StreamCodec<io.netty.buffer.ByteBuf,net.minecraft.nbt.Tag> TAG
    • TRUSTED_TAG

      static final StreamCodec<io.netty.buffer.ByteBuf,net.minecraft.nbt.Tag> TRUSTED_TAG
    • COMPOUND_TAG

      static final StreamCodec<io.netty.buffer.ByteBuf,net.minecraft.nbt.CompoundTag> COMPOUND_TAG
    • TRUSTED_COMPOUND_TAG

      static final StreamCodec<io.netty.buffer.ByteBuf,net.minecraft.nbt.CompoundTag> TRUSTED_COMPOUND_TAG
    • OPTIONAL_COMPOUND_TAG

      static final StreamCodec<io.netty.buffer.ByteBuf,Optional<net.minecraft.nbt.CompoundTag>> OPTIONAL_COMPOUND_TAG
    • VECTOR3F

      static final StreamCodec<io.netty.buffer.ByteBuf,org.joml.Vector3f> VECTOR3F
    • QUATERNIONF

      static final StreamCodec<io.netty.buffer.ByteBuf,org.joml.Quaternionf> QUATERNIONF
    • GAME_PROFILE_PROPERTIES

      static final StreamCodec<io.netty.buffer.ByteBuf,com.mojang.authlib.properties.PropertyMap> GAME_PROFILE_PROPERTIES
    • GAME_PROFILE

      static final StreamCodec<io.netty.buffer.ByteBuf,com.mojang.authlib.GameProfile> GAME_PROFILE
    • LONG_ARRAY

      static final StreamCodec<io.netty.buffer.ByteBuf,long[]> LONG_ARRAY
    • OPTIONAL_VAR_INT

      static final StreamCodec<io.netty.buffer.ByteBuf,OptionalInt> OPTIONAL_VAR_INT
    • RESOURCE_LOCATION

      static final StreamCodec<io.netty.buffer.ByteBuf,net.minecraft.resources.ResourceLocation> RESOURCE_LOCATION
    • BLOCK_POS

      static final StreamCodec<io.netty.buffer.ByteBuf,net.minecraft.core.BlockPos> BLOCK_POS
    • VEC3

      static final StreamCodec<io.netty.buffer.ByteBuf,net.minecraft.world.phys.Vec3> VEC3
    • CHUNK_POS

      static final StreamCodec<io.netty.buffer.ByteBuf,net.minecraft.world.level.ChunkPos> CHUNK_POS
    • DIMENSION

      static final StreamCodec<io.netty.buffer.ByteBuf,net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level>> DIMENSION
    • GLOBAL_POS

      static final StreamCodec<io.netty.buffer.ByteBuf,net.minecraft.core.GlobalPos> GLOBAL_POS
    • DIRECTION

      static final StreamCodec<io.netty.buffer.ByteBuf,net.minecraft.core.Direction> DIRECTION
    • UUID

      static final StreamCodec<io.netty.buffer.ByteBuf,UUID> UUID
    • COMPONENT

      static final StreamCodec<io.netty.buffer.ByteBuf,net.minecraft.network.chat.Component> COMPONENT
    • OPTIONAL_ITEM_STACK

      static final StreamCodec<io.netty.buffer.ByteBuf,net.minecraft.world.item.ItemStack> OPTIONAL_ITEM_STACK
      An item stack, which may be empty (1.20.5+'s ByteBufCodecs.OPTIONAL_ITEM_STACK).
    • ITEM_STACK

      static final StreamCodec<io.netty.buffer.ByteBuf,net.minecraft.world.item.ItemStack> ITEM_STACK
      A non-empty item stack (1.20.5+'s ByteBufCodecs.ITEM_STACK).
  • Method Details

    • stringUtf8

      static StreamCodec<io.netty.buffer.ByteBuf,String> stringUtf8(int maxLength)
    • tagCodec

      static StreamCodec<io.netty.buffer.ByteBuf,net.minecraft.nbt.Tag> tagCodec(Supplier<net.minecraft.nbt.NbtAccounter> accounter)
    • compoundTagCodec

      static StreamCodec<io.netty.buffer.ByteBuf,net.minecraft.nbt.CompoundTag> compoundTagCodec(Supplier<net.minecraft.nbt.NbtAccounter> accounter)
    • optional

      static <B extends io.netty.buffer.ByteBuf, V> StreamCodec<B,Optional<V>> optional(StreamCodec<B,V> codec)
    • readCount

      static int readCount(io.netty.buffer.ByteBuf buf, int max)
    • writeCount

      static void writeCount(io.netty.buffer.ByteBuf buf, int count, int max)
    • collection

      static <B extends io.netty.buffer.ByteBuf, V, C extends Collection<V>> StreamCodec<B,C> collection(IntFunction<C> factory, StreamCodec<? super B,V> codec, int max)
    • collection

      static <B extends io.netty.buffer.ByteBuf, V, C extends Collection<V>> StreamCodec<B,C> collection(IntFunction<C> factory, StreamCodec<? super B,V> codec)
    • collection

      static <B extends io.netty.buffer.ByteBuf, V, C extends Collection<V>> StreamCodec.CodecOperation<B,V,C> collection(IntFunction<C> factory)
    • list

      static <B extends io.netty.buffer.ByteBuf, V> StreamCodec.CodecOperation<B,V,List<V>> list()
    • list

      static <B extends io.netty.buffer.ByteBuf, V> StreamCodec.CodecOperation<B,V,List<V>> list(int max)
    • map

      static <B extends io.netty.buffer.ByteBuf, K, V, M extends Map<K, V>> StreamCodec<B,M> map(IntFunction<? extends M> factory, 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> factory, StreamCodec<? super B,K> keyCodec, StreamCodec<? super B,V> valueCodec, int max)
    • either

      static <B extends io.netty.buffer.ByteBuf, L, R> StreamCodec<B,com.mojang.datafixers.util.Either<L,R>> either(StreamCodec<? super B,L> left, StreamCodec<? super B,R> right)
    • idMapper

      static <T> StreamCodec<io.netty.buffer.ByteBuf,T> idMapper(net.minecraft.core.IdMap<T> idMap)
      A value by its id in an IdMap, such as Block.BLOCK_STATE_REGISTRY.
    • idMapper

      static <T> StreamCodec<io.netty.buffer.ByteBuf,T> idMapper(IntFunction<T> byId, ToIntFunction<T> toId)
    • registry

      static <T> StreamCodec<io.netty.buffer.ByteBuf,T> registry(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> registryKey)
      A value by its network id in one of the built-in registries (1.20.1's buffers carry no registry access).
    • fromCodec

      static <T> StreamCodec<io.netty.buffer.ByteBuf,T> fromCodec(com.mojang.serialization.Codec<T> codec)
      A value written with its Codec as NBT.
    • fromCodec

      static <T> StreamCodec<io.netty.buffer.ByteBuf,T> fromCodec(com.mojang.serialization.Codec<T> codec, Supplier<net.minecraft.nbt.NbtAccounter> accounter)
    • fromCodecWithRegistries

      static <T> StreamCodec<io.netty.buffer.ByteBuf,T> fromCodecWithRegistries(com.mojang.serialization.Codec<T> codec)
      Like fromCodec(Codec), with the registry access of the running server or client world when there is one (1.20.1's buffers carry none).