Object HTCodecs

  • All Implemented Interfaces:

    
    public class HTCodecs
    
                        

    Hiiragi Coreとそれを前提とするmodで使用されるCodecとMapCodecをまとめたクラスです。

    Since:

    0.16.0

    Author:

    Hiiragi Tsubasa

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static <K extends Any, V extends Any> Codec<Map<K, V>> mapOf(Codec<K> keyCodec, Codec<V> valueCodec)
      final static <L extends Any, R extends Any> MapCodec<Ior<L, R>> ior(MapCodec<L> left, MapCodec<R> right) 指定したleft, rightから,IorのMapCodecを返します。
      final static <V extends Enum<V>> Codec<V> stringEnum(Function<V, String> factory) EnumのCodecを返します。
      final static <N extends Number, Comparable<N>> Codec<N> numberRange(Codec<N> codec, ClosedRange<N> range)
      final static <T extends Any> Codec<ResourceKey<T>> resourceKey(ResourceKey<out Registry<T>> registryKey) 指定したregistryKeyからResourceKeyのCodecを返します。
      final static <T extends Any> Codec<TagKey<T>> tagKey(ResourceKey<out Registry<T>> registryKey, Boolean withHash) 指定したregistryKeyからTagKeyのCodecを返します。
      final static <T extends Any> Codec<Holder<T>> holder(ResourceKey<out Registry<T>> registryKey) 指定したregistryKeyからHolderのCodecを返します。
      final static <T extends Any> Codec<HolderSet<T>> holderSet(ResourceKey<out Registry<T>> registryKey) 指定したregistryKeyからHolderSetのCodecを返します。
      final static <T extends Any> Codec<HTHolderLike<T, T>> holderLike(ResourceKey<out Registry<T>> registryKey) 指定したregistryKeyからHTSimpleHolderLikeのCodecを返します。
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • mapOf

         final static <K extends Any, V extends Any> Codec<Map<K, V>> mapOf(Codec<K> keyCodec, Codec<V> valueCodec)
      • ior

         final static <L extends Any, R extends Any> MapCodec<Ior<L, R>> ior(MapCodec<L> left, MapCodec<R> right)

        指定したleft, rightから,IorのMapCodecを返します。

        Parameters:
        left - Lを対象とするMapCodec
        right - Rを対象とするMapCodec
        Returns:

        IorのMapCodec

      • resourceKey

         final static <T extends Any> Codec<ResourceKey<T>> resourceKey(ResourceKey<out Registry<T>> registryKey)

        指定したregistryKeyからResourceKeyのCodecを返します。

      • tagKey

         final static <T extends Any> Codec<TagKey<T>> tagKey(ResourceKey<out Registry<T>> registryKey, Boolean withHash)

        指定したregistryKeyからTagKeyのCodecを返します。

        Parameters:
        withHash - 変換後の文字列の先頭に'#'をつけるかどうか
      • holder

         final static <T extends Any> Codec<Holder<T>> holder(ResourceKey<out Registry<T>> registryKey)

        指定したregistryKeyからHolderのCodecを返します。

      • holderSet

         final static <T extends Any> Codec<HolderSet<T>> holderSet(ResourceKey<out Registry<T>> registryKey)

        指定したregistryKeyからHolderSetのCodecを返します。

      • holderLike

         final static <T extends Any> Codec<HTHolderLike<T, T>> holderLike(ResourceKey<out Registry<T>> registryKey)

        指定したregistryKeyからHTSimpleHolderLikeのCodecを返します。

        Since:

        0.13.0