public interface StringIdentifiable
Modifier and Type | Method and Description |
---|---|
String |
asString() |
static <E extends Enum<E> & StringIdentifiable> |
createCodec(Supplier<E[]> enumValues,
Function<? super String,? extends E> fromString)
Creates a codec that serializes an enum implementing this interface either
using its ordinals (when compressed) or using its
asString() method
and a given decode function. |
static <E extends StringIdentifiable> |
createCodec(ToIntFunction<E> compressedEncoder,
IntFunction<E> compressedDecoder,
Function<? super String,? extends E> decoder)
Creates a codec that serializes a class implementing this interface using either
the given toInt and fromInt mapping functions (when compressed output is
requested), or its
asString() method and a given fromString function. |
static com.mojang.serialization.Keyable |
method_28142(StringIdentifiable[] stringIdentifiable) |
String asString()
static <E extends Enum<E> & StringIdentifiable> com.mojang.serialization.Codec<E> createCodec(Supplier<E[]> enumValues, Function<? super String,? extends E> fromString)
asString()
method
and a given decode function.static <E extends StringIdentifiable> com.mojang.serialization.Codec<E> createCodec(ToIntFunction<E> compressedEncoder, IntFunction<E> compressedDecoder, Function<? super String,? extends E> decoder)
asString()
method and a given fromString function.static com.mojang.serialization.Keyable method_28142(StringIdentifiable[] stringIdentifiable)