Interface StringIdentifiable

All Known Implementing Classes:
Attachment, BambooLeaves, BedPart, Biome.Category, Biome.Precipitation, Biome.TemperatureModifier, BiomeEffects.GrassColorModifier, BlockHalf, ChestType, ComparatorMode, Direction, Direction.Axis, DirectionTransformation, DoorHinge, DoubleBlockHalf, DyeColor, GenerationStep.Carver, Heightmap.Type, Instrument, JigsawBlockEntity.Joint, JigsawOrientation, MineshaftFeature.Type, OceanRuinFeature.BiomeType, PistonType, RailShape, RuinedPortalFeature.Type, SlabType, SpawnGroup, StairShape, StructureBlockMode, StructurePool.Projection, WallMountLocation, WallShape, WireConnection

public interface StringIdentifiable
  • Method Summary

    Modifier and Type Method Description
    String asString()  
    static <E extends Enum<E> & StringIdentifiable>
    com.mojang.serialization.Codec<E>
    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>
    com.mojang.serialization.Codec<E>
    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)  
  • Method Details

    • asString

      String asString()
    • createCodec

      static <E extends Enum<E> & StringIdentifiable> com.mojang.serialization.Codec<E> 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.
    • createCodec

      static <E extends StringIdentifiable> com.mojang.serialization.Codec<E> 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.
    • method_28142

      static com.mojang.serialization.Keyable method_28142​(StringIdentifiable[] stringIdentifiable)