Object HTCodecs
-
- All Implemented Interfaces:
public class HTCodecsHiiragi Coreとそれを前提とするmodで使用されるCodecとMapCodecをまとめたクラスです。
- Since:
0.16.0
Hiiragi Tsubasa
-
-
Field Summary
Fields Modifier and Type Field Description public final static Codec<Fraction>FRACTIONpublic final static Codec<Ingredient>INGREDIENTpublic final static MapCodec<FluidIngredient>FLUID_INGREDIENTpublic final static Codec<Component>TEXTpublic final static Codec<UUID>UUIDpublic final static Codec<Integer>NON_NEGATIVE_INTpublic final static Codec<Long>NON_NEGATIVE_LONGpublic final static Codec<Fraction>NON_NEGATIVE_FRACTIONpublic final static Codec<Integer>POSITIVE_INTpublic final static Codec<Long>POSITIVE_LONGpublic final static HTCodecsINSTANCE
-
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を返します。 -
-
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)
-
stringEnum
final static <V extends Enum<V>> Codec<V> stringEnum(Function<V, String> factory)
EnumのCodecを返します。
-
numberRange
final static <N extends Number, Comparable<N>> Codec<N> numberRange(Codec<N> codec, ClosedRange<N> range)
-
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
-
-
-
-