Interface Codec<T>
- Type Parameters:
T
- The type to be represented by this codec
- All Known Subinterfaces:
DataComponent<T>
,StructCodec<R>
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final @NotNull Codec
<byte[]> static final @NotNull Codec
<int[]> static final @NotNull Codec
<net.kyori.adventure.key.Key> static final @NotNull Codec
<long[]> static final @NotNull Codec
<net.kyori.adventure.nbt.BinaryTag> static final @NotNull Codec
<net.kyori.adventure.nbt.CompoundBinaryTag> static final @NotNull Codec
<Codec.RawValue> -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> @NotNull Codec
<T> ForwardRef
(@NotNull Supplier<Codec<T>> func) list()
list
(int maxSize) listOrSingle
(int maxSize) optional()
static <T> @NotNull Codec
<T> static <T> @NotNull StructCodec
<T> RegistryTaggedUnion
(Registries.Selector<StructCodec<? extends T>> registrySelector, @NotNull Function<T, StructCodec<? extends T>> serializerGetter, @NotNull String key) set()
set
(int maxSize) default <S> @NotNull Codec
<S> transform
(@NotNull ThrowingFunction<T, S> to, @NotNull ThrowingFunction<S, T> from) default <R, T1 extends T, TR extends R>
StructCodec<R> unionType
(@NotNull String keyField, @NotNull Function<T, StructCodec<TR>> serializers, @NotNull Function<R, T1> keyFunc) default <R, T1 extends T, TR extends R>
StructCodec<R> unionType
(@NotNull Function<T, StructCodec<TR>> serializers, @NotNull Function<R, T1> keyFunc)
-
Field Details
-
RAW_VALUE
-
UNIT
-
BOOLEAN
-
BYTE
-
SHORT
-
INT
-
LONG
-
FLOAT
-
DOUBLE
-
STRING
-
KEY
-
BYTE_ARRAY
-
INT_ARRAY
-
LONG_ARRAY
-
UUID
-
UUID_COERCED
-
COMPONENT
-
BLOCK_POSITION
-
VECTOR3D
-
NBT
-
NBT_COMPOUND
-
-
Method Details
-
Enum
-
Recursive
-
ForwardRef
-
RegistryTaggedUnion
@NotNull static <T> @NotNull StructCodec<T> RegistryTaggedUnion(@NotNull Registries.Selector<StructCodec<? extends T>> registrySelector, @NotNull @NotNull Function<T, StructCodec<? extends T>> serializerGetter, @NotNull @NotNull String key) -
Either
-
optional
-
optional
-
transform
@NotNull default <S> @NotNull Codec<S> transform(@NotNull @NotNull ThrowingFunction<T, S> to, @NotNull @NotNull ThrowingFunction<S, T> from) -
list
-
list
-
listOrSingle
-
listOrSingle
-
set
-
set
-
mapValue
-
mapValue
-
unionType
default <R, T1 extends T, TR extends R> StructCodec<R> unionType(@NotNull @NotNull Function<T, StructCodec<TR>> serializers, @NotNull @NotNull Function<R, T1> keyFunc) -
unionType
default <R, T1 extends T, TR extends R> StructCodec<R> unionType(@NotNull @NotNull String keyField, @NotNull @NotNull Function<T, StructCodec<TR>> serializers, @NotNull @NotNull Function<R, T1> keyFunc) -
orElse
-