Object HTStreamCodecs

  • All Implemented Interfaces:

    
    public class HTStreamCodecs
    
                        

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

    Since:

    0.16.0

    Author:

    Hiiragi Tsubasa

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static StreamCodec<ByteBuf, Fraction> FRACTION
      public final static StreamCodec<RegistryFriendlyByteBuf, Component> TEXT
      public final static StreamCodec<ByteBuf, UUID> UUID
      public final static HTStreamCodecs INSTANCE
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static <V extends Enum<V>> StreamCodec<ByteBuf, V> enum(ByIdMap.OutOfBoundsStrategy strategy)
      final static <B extends ByteBuf, L extends Any, R extends Any> StreamCodec<B, Ior<L, R>> ior(StreamCodec<in B, L> left, StreamCodec<in B, R> right) 指定したleft, rightから,IorのStreamCodecを返します。
      final static <B extends ByteBuf, K extends Any, V extends Any> StreamCodec<B, Map<K, V>> mapOf(StreamCodec<in B, K> keyCodec, StreamCodec<in B, V> valueCodec)
      final static <T extends Any> StreamCodec<ByteBuf, ResourceKey<T>> resourceKey(ResourceKey<out Registry<T>> registryKey) 指定したregistryKeyからResourceKeyのStreamCodecを返します。
      final static <T extends Any> StreamCodec<ByteBuf, TagKey<T>> tagKey(ResourceKey<out Registry<T>> registryKey, Boolean withHash) 指定したregistryKeyからTagKeyのStreamCodecを返します。
      final static <T extends Any> StreamCodec<RegistryFriendlyByteBuf, Holder<T>> holder(ResourceKey<out Registry<T>> registryKey) 指定したregistryKeyからHolderのStreamCodecを返します。
      final static <T extends Any> StreamCodec<RegistryFriendlyByteBuf, HolderSet<T>> holderSet(ResourceKey<out Registry<T>> registryKey) 指定したregistryKeyからHolderSetのStreamCodecを返します。
      final static <T extends Any> StreamCodec<RegistryFriendlyByteBuf, HTHolderLike<T, T>> holderLike(ResourceKey<out Registry<T>> registryKey) 指定したregistryKeyからHTSimpleHolderLikeのStreamCodecを返します。
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • enum

         final static <V extends Enum<V>> StreamCodec<ByteBuf, V> enum(ByIdMap.OutOfBoundsStrategy strategy)
      • ior

         final static <B extends ByteBuf, L extends Any, R extends Any> StreamCodec<B, Ior<L, R>> ior(StreamCodec<in B, L> left, StreamCodec<in B, R> right)

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

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

        IorのStreamCodec

      • mapOf

         final static <B extends ByteBuf, K extends Any, V extends Any> StreamCodec<B, Map<K, V>> mapOf(StreamCodec<in B, K> keyCodec, StreamCodec<in B, V> valueCodec)
      • resourceKey

         final static <T extends Any> StreamCodec<ByteBuf, ResourceKey<T>> resourceKey(ResourceKey<out Registry<T>> registryKey)

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

      • tagKey

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

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

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

         final static <T extends Any> StreamCodec<RegistryFriendlyByteBuf, Holder<T>> holder(ResourceKey<out Registry<T>> registryKey)

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

      • holderSet

         final static <T extends Any> StreamCodec<RegistryFriendlyByteBuf, HolderSet<T>> holderSet(ResourceKey<out Registry<T>> registryKey)

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

      • holderLike

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

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

        Since:

        0.13.0