Class RegistryKeyCodec<E>

  • All Implemented Interfaces:
    com.mojang.serialization.Codec<java.util.function.Supplier<E>>, com.mojang.serialization.Decoder<java.util.function.Supplier<E>>, com.mojang.serialization.Encoder<java.util.function.Supplier<E>>

    public final class RegistryKeyCodec<E>
    extends java.lang.Object
    implements com.mojang.serialization.Codec<java.util.function.Supplier<E>>
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface com.mojang.serialization.Codec

        com.mojang.serialization.Codec.ResultFunction<A extends java.lang.Object>
      • Nested classes/interfaces inherited from interface com.mojang.serialization.Decoder

        com.mojang.serialization.Decoder.Boxed<A extends java.lang.Object>, com.mojang.serialization.Decoder.Simple<A extends java.lang.Object>, com.mojang.serialization.Decoder.Terminal<A extends java.lang.Object>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean allowInline  
      private com.mojang.serialization.Codec<E> elementCodec  
      private RegistryKey<? extends Registry<E>> registryKey  
      • Fields inherited from interface com.mojang.serialization.Codec

        BOOL, BYTE, BYTE_BUFFER, DOUBLE, EMPTY, FLOAT, INT, INT_STREAM, LONG, LONG_STREAM, PASSTHROUGH, SHORT, STRING
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private RegistryKeyCodec​(RegistryKey<? extends Registry<E>> p_i242090_1_, com.mojang.serialization.Codec<E> p_i242090_2_, boolean p_i242090_3_)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static <E> RegistryKeyCodec<E> create​(RegistryKey<? extends Registry<E>> p_241794_0_, com.mojang.serialization.Codec<E> p_241794_1_)  
      private static <E> RegistryKeyCodec<E> create​(RegistryKey<? extends Registry<E>> p_244325_0_, com.mojang.serialization.Codec<E> p_244325_1_, boolean p_244325_2_)  
      <T> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<java.util.function.Supplier<E>,​T>> decode​(com.mojang.serialization.DynamicOps<T> p_decode_1_, T p_decode_2_)  
      <T> com.mojang.serialization.DataResult<T> encode​(java.util.function.Supplier<E> p_encode_1_, com.mojang.serialization.DynamicOps<T> p_encode_2_, T p_encode_3_)  
      static <E> com.mojang.serialization.Codec<java.util.List<java.util.function.Supplier<E>>> homogeneousList​(RegistryKey<? extends Registry<E>> p_244328_0_, com.mojang.serialization.Codec<E> p_244328_1_)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface com.mojang.serialization.Codec

        comapFlatMap, deprecated, dispatch, dispatch, dispatchMap, dispatchMap, dispatchStable, fieldOf, flatComapMap, flatXmap, listOf, mapResult, optionalFieldOf, optionalFieldOf, optionalFieldOf, optionalFieldOf, orElse, orElse, orElse, orElseGet, orElseGet, orElseGet, partialDispatch, promotePartial, stable, withLifecycle, xmap
      • Methods inherited from interface com.mojang.serialization.Decoder

        boxed, decode, flatMap, map, parse, parse, simple, terminal
      • Methods inherited from interface com.mojang.serialization.Encoder

        comap, encodeStart, flatComap
    • Field Detail

      • elementCodec

        private final com.mojang.serialization.Codec<E> elementCodec
      • allowInline

        private final boolean allowInline
    • Constructor Detail

      • RegistryKeyCodec

        private RegistryKeyCodec​(RegistryKey<? extends Registry<E>> p_i242090_1_,
                                 com.mojang.serialization.Codec<E> p_i242090_2_,
                                 boolean p_i242090_3_)
    • Method Detail

      • homogeneousList

        public static <E> com.mojang.serialization.Codec<java.util.List<java.util.function.Supplier<E>>> homogeneousList​(RegistryKey<? extends Registry<E>> p_244328_0_,
                                                                                                                         com.mojang.serialization.Codec<E> p_244328_1_)
      • create

        private static <E> RegistryKeyCodec<E> create​(RegistryKey<? extends Registry<E>> p_244325_0_,
                                                      com.mojang.serialization.Codec<E> p_244325_1_,
                                                      boolean p_244325_2_)
      • encode

        public <T> com.mojang.serialization.DataResult<T> encode​(java.util.function.Supplier<E> p_encode_1_,
                                                                 com.mojang.serialization.DynamicOps<T> p_encode_2_,
                                                                 T p_encode_3_)
        Specified by:
        encode in interface com.mojang.serialization.Encoder<E>
      • decode

        public <T> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<java.util.function.Supplier<E>,​T>> decode​(com.mojang.serialization.DynamicOps<T> p_decode_1_,
                                                                                                                                       T p_decode_2_)
        Specified by:
        decode in interface com.mojang.serialization.Decoder<E>
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object