Package net.minestom.server.utils.nbt
Interface BinaryTagSerializer<T>
@Internal
public interface BinaryTagSerializer<T>
API Note: This class and associated types are currently considered an internal api. It is likely there will be significant changes in the future, and there will not be backwards compatibility for this. Use at your own risk.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
static final record
static interface
static interface
static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BinaryTagSerializer
<Point> static final BinaryTagSerializer
<Boolean> static final BinaryTagSerializer
<Byte> static final BinaryTagSerializer
<net.kyori.adventure.nbt.CompoundBinaryTag> static final BinaryTagSerializer
<net.kyori.adventure.nbt.CompoundBinaryTag> static final BinaryTagSerializer
<Float> static final BinaryTagSerializer
<Integer> static final BinaryTagSerializer
<ItemStack> static final BinaryTagSerializer
<Component> static final BinaryTagSerializer
<Component> static final BinaryTagSerializer
<Style> static final BinaryTagSerializer
<String> static final BinaryTagSerializer
<Unit> static final BinaryTagSerializer
<UUID> -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends net.kyori.adventure.nbt.BinaryTag>
@NotNull BinaryTagSerializer<T> coerced
(@NotNull net.kyori.adventure.nbt.BinaryTagType<T> type) static <E extends Enum<E>>
@NotNull BinaryTagSerializer<E> fromEnumStringable
(@NotNull Class<E> enumClass) static <T> @NotNull BinaryTagSerializer
<T> lazy
(@NotNull Supplier<BinaryTagSerializer<T>> self) default BinaryTagSerializer
<List<T>> list()
default <S> BinaryTagSerializer
<S> static <P1,
P2, P3, P4, P5, R>
@NotNull BinaryTagSerializer<R> object
(@NotNull String param1, @NotNull BinaryTagSerializer<P1> serializer1, @NotNull Function<R, P1> getter1, @NotNull String param2, @NotNull BinaryTagSerializer<P2> serializer2, @NotNull Function<R, P2> getter2, @NotNull String param3, @NotNull BinaryTagSerializer<P3> serializer3, @NotNull Function<R, P3> getter3, @NotNull String param4, @NotNull BinaryTagSerializer<P4> serializer4, @NotNull Function<R, P4> getter4, @NotNull String param5, @NotNull BinaryTagSerializer<P5> serializer5, @NotNull Function<R, P5> getter5, @NotNull BinaryTagSerializer.Function5<P1, P2, P3, P4, P5, R> constructor) static <P1,
P2, P3, P4, R>
@NotNull BinaryTagSerializer<R> object
(@NotNull String param1, @NotNull BinaryTagSerializer<P1> serializer1, @NotNull Function<R, P1> getter1, @NotNull String param2, @NotNull BinaryTagSerializer<P2> serializer2, @NotNull Function<R, P2> getter2, @NotNull String param3, @NotNull BinaryTagSerializer<P3> serializer3, @NotNull Function<R, P3> getter3, @NotNull String param4, @NotNull BinaryTagSerializer<P4> serializer4, @NotNull Function<R, P4> getter4, @NotNull BinaryTagSerializer.Function4<P1, P2, P3, P4, R> constructor) static <P1,
P2, P3, R>
@NotNull BinaryTagSerializer<R> object
(@NotNull String param1, @NotNull BinaryTagSerializer<P1> serializer1, @NotNull Function<R, P1> getter1, @NotNull String param2, @NotNull BinaryTagSerializer<P2> serializer2, @NotNull Function<R, P2> getter2, @NotNull String param3, @NotNull BinaryTagSerializer<P3> serializer3, @NotNull Function<R, P3> getter3, @NotNull BinaryTagSerializer.Function3<P1, P2, P3, R> constructor) static <P1,
P2, R>
@NotNull BinaryTagSerializer<R> object
(@NotNull String param1, @NotNull BinaryTagSerializer<P1> serializer1, @NotNull Function<R, P1> getter1, @NotNull String param2, @NotNull BinaryTagSerializer<P2> serializer2, @NotNull Function<R, P2> getter2, @NotNull BiFunction<P1, P2, R> constructor) static <P1,
R> @NotNull BinaryTagSerializer <R> object
(@NotNull String param1, @NotNull BinaryTagSerializer<P1> serializer1, @NotNull Function<R, P1> getter1, @NotNull Function<P1, R> constructor) default BinaryTagSerializer
<@Nullable T> optional()
default BinaryTagSerializer
<@UnknownNullability T> default T
read
(@NotNull net.kyori.adventure.nbt.BinaryTag tag) default T
read
(@NotNull BinaryTagSerializer.Context context, @NotNull net.kyori.adventure.nbt.BinaryTag tag) static <T> @NotNull BinaryTagSerializer
<T> recursive
(@NotNull Function<BinaryTagSerializer<T>, BinaryTagSerializer<T>> self) static <T extends ProtocolObject>
@NotNull BinaryTagSerializer<DynamicRegistry.Key<T>> registryKey
(@NotNull Function<Registries, DynamicRegistry<T>> registrySelector) static <T> @NotNull BinaryTagSerializer
<T> registryTaggedUnion
(@NotNull Function<Registries, DynamicRegistry<BinaryTagSerializer<? extends T>>> registrySelector, @NotNull Function<T, BinaryTagSerializer<? extends T>> serializerGetter, @NotNull String key) default @NotNull net.kyori.adventure.nbt.BinaryTag
write
(@NotNull BinaryTagSerializer.Context context, T value) default @NotNull net.kyori.adventure.nbt.BinaryTag
-
Field Details
-
UNIT
-
BYTE
-
BOOLEAN
-
INT
-
FLOAT
-
STRING
-
COMPOUND
-
COMPOUND_COERCED
-
JSON_COMPONENT
-
NBT_COMPONENT
-
NBT_COMPONENT_STYLE
-
ITEM
-
UUID
-
BLOCK_POSITION
-
-
Method Details
-
recursive
@NotNull static <T> @NotNull BinaryTagSerializer<T> recursive(@NotNull @NotNull Function<BinaryTagSerializer<T>, BinaryTagSerializer<T>> self) -
lazy
@NotNull static <T> @NotNull BinaryTagSerializer<T> lazy(@NotNull @NotNull Supplier<BinaryTagSerializer<T>> self) -
coerced
@NotNull static <T extends net.kyori.adventure.nbt.BinaryTag> @NotNull BinaryTagSerializer<T> coerced(@NotNull @NotNull net.kyori.adventure.nbt.BinaryTagType<T> type) -
fromEnumStringable
@NotNull static <E extends Enum<E>> @NotNull BinaryTagSerializer<E> fromEnumStringable(@NotNull @NotNull Class<E> enumClass) -
registryKey
@NotNull static <T extends ProtocolObject> @NotNull BinaryTagSerializer<DynamicRegistry.Key<T>> registryKey(@NotNull @NotNull Function<Registries, DynamicRegistry<T>> registrySelector) -
object
@NotNull static <P1,R> @NotNull BinaryTagSerializer<R> object(@NotNull @NotNull String param1, @NotNull @NotNull BinaryTagSerializer<P1> serializer1, @NotNull @NotNull Function<R, P1> getter1, @NotNull @NotNull Function<P1, R> constructor) -
object
@NotNull static <P1,P2, @NotNull BinaryTagSerializer<R> objectR> (@NotNull @NotNull String param1, @NotNull @NotNull BinaryTagSerializer<P1> serializer1, @NotNull @NotNull Function<R, P1> getter1, @NotNull @NotNull String param2, @NotNull @NotNull BinaryTagSerializer<P2> serializer2, @NotNull @NotNull Function<R, P2> getter2, @NotNull @NotNull BiFunction<P1, P2, R> constructor) -
object
@NotNull static <P1,P2, @NotNull BinaryTagSerializer<R> objectP3, R> (@NotNull @NotNull String param1, @NotNull @NotNull BinaryTagSerializer<P1> serializer1, @NotNull @NotNull Function<R, P1> getter1, @NotNull @NotNull String param2, @NotNull @NotNull BinaryTagSerializer<P2> serializer2, @NotNull @NotNull Function<R, P2> getter2, @NotNull @NotNull String param3, @NotNull @NotNull BinaryTagSerializer<P3> serializer3, @NotNull @NotNull Function<R, P3> getter3, @NotNull @NotNull BinaryTagSerializer.Function3<P1, P2, P3, R> constructor) -
object
@NotNull static <P1,P2, @NotNull BinaryTagSerializer<R> objectP3, P4, R> (@NotNull @NotNull String param1, @NotNull @NotNull BinaryTagSerializer<P1> serializer1, @NotNull @NotNull Function<R, P1> getter1, @NotNull @NotNull String param2, @NotNull @NotNull BinaryTagSerializer<P2> serializer2, @NotNull @NotNull Function<R, P2> getter2, @NotNull @NotNull String param3, @NotNull @NotNull BinaryTagSerializer<P3> serializer3, @NotNull @NotNull Function<R, P3> getter3, @NotNull @NotNull String param4, @NotNull @NotNull BinaryTagSerializer<P4> serializer4, @NotNull @NotNull Function<R, P4> getter4, @NotNull @NotNull BinaryTagSerializer.Function4<P1, P2, P3, P4, R> constructor) -
object
@NotNull static <P1,P2, @NotNull BinaryTagSerializer<R> objectP3, P4, P5, R> (@NotNull @NotNull String param1, @NotNull @NotNull BinaryTagSerializer<P1> serializer1, @NotNull @NotNull Function<R, P1> getter1, @NotNull @NotNull String param2, @NotNull @NotNull BinaryTagSerializer<P2> serializer2, @NotNull @NotNull Function<R, P2> getter2, @NotNull @NotNull String param3, @NotNull @NotNull BinaryTagSerializer<P3> serializer3, @NotNull @NotNull Function<R, P3> getter3, @NotNull @NotNull String param4, @NotNull @NotNull BinaryTagSerializer<P4> serializer4, @NotNull @NotNull Function<R, P4> getter4, @NotNull @NotNull String param5, @NotNull @NotNull BinaryTagSerializer<P5> serializer5, @NotNull @NotNull Function<R, P5> getter5, @NotNull @NotNull BinaryTagSerializer.Function5<P1, P2, P3, P4, P5, R> constructor) -
registryTaggedUnion
@NotNull static <T> @NotNull BinaryTagSerializer<T> registryTaggedUnion(@NotNull @NotNull Function<Registries, DynamicRegistry<BinaryTagSerializer<? extends T>>> registrySelector, @NotNull @NotNull Function<T, BinaryTagSerializer<? extends T>> serializerGetter, @NotNull @NotNull String key) -
write
@NotNull default @NotNull net.kyori.adventure.nbt.BinaryTag write(@NotNull @NotNull BinaryTagSerializer.Context context, @NotNull T value) -
read
@NotNull default T read(@NotNull @NotNull BinaryTagSerializer.Context context, @NotNull @NotNull net.kyori.adventure.nbt.BinaryTag tag) -
write
-
read
-
optional
-
optional
-
map
default <S> BinaryTagSerializer<S> map(@NotNull @NotNull Function<T, S> to, @NotNull @NotNull Function<S, T> from) -
list
-