Class HolderSetCodec<E>

java.lang.Object
net.minecraft.resources.HolderSetCodec<E>
All Implemented Interfaces:
com.mojang.serialization.Codec<HolderSet<E>>, com.mojang.serialization.Decoder<HolderSet<E>>, com.mojang.serialization.Encoder<HolderSet<E>>

public class HolderSetCodec<E> extends Object implements com.mojang.serialization.Codec<HolderSet<E>>
  • Nested Class Summary

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

    com.mojang.serialization.Codec.ResultFunction<A extends Object>

    Nested classes/interfaces inherited from interface com.mojang.serialization.Decoder

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

    Fields
    Modifier and Type
    Field
    Description
    private final com.mojang.serialization.Codec<com.mojang.datafixers.util.Either<ICustomHolderSet<E>,com.mojang.datafixers.util.Either<TagKey<E>,List<Holder<E>>>>>
     
    private final com.mojang.serialization.Codec<Holder<E>>
     
    private final com.mojang.serialization.Codec<ICustomHolderSet<E>>
     
    private final com.mojang.serialization.Codec<List<Holder<E>>>
     
    private final com.mojang.serialization.Codec<com.mojang.datafixers.util.Either<TagKey<E>,List<Holder<E>>>>
     
    private final ResourceKey<? extends Registry<E>>
     

    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
    HolderSetCodec(ResourceKey<? extends Registry<E>> p_206660_, com.mojang.serialization.Codec<Holder<E>> p_206661_, boolean p_206662_)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <E> com.mojang.serialization.Codec<HolderSet<E>>
    create(ResourceKey<? extends Registry<E>> p_206686_, com.mojang.serialization.Codec<Holder<E>> p_206687_, boolean p_206688_)
     
    <T> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<HolderSet<E>,T>>
    decode(com.mojang.serialization.DynamicOps<T> p_206696_, T p_206697_)
     
    private <T> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<HolderSet<E>,T>>
    decodeWithoutRegistry(com.mojang.serialization.DynamicOps<T> p_206671_, T p_206672_)
     
    <T> com.mojang.serialization.DataResult<T>
    encode(HolderSet<E> p_206674_, com.mojang.serialization.DynamicOps<T> p_206675_, T p_206676_)
     
    private <T> com.mojang.serialization.DataResult<T>
    encodeWithoutRegistry(HolderSet<E> p_206690_, com.mojang.serialization.DynamicOps<T> p_206691_, T p_206692_)
     
    private static <E> com.mojang.serialization.Codec<List<Holder<E>>>
    homogenousList(com.mojang.serialization.Codec<Holder<E>> p_206668_, boolean p_206669_)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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 Details

    • registryKey

      private final ResourceKey<? extends Registry<E>> registryKey
    • elementCodec

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

      private final com.mojang.serialization.Codec<List<Holder<E>>> homogenousListCodec
    • registryAwareCodec

      private final com.mojang.serialization.Codec<com.mojang.datafixers.util.Either<TagKey<E>,List<Holder<E>>>> registryAwareCodec
    • forgeDispatchCodec

      private final com.mojang.serialization.Codec<ICustomHolderSet<E>> forgeDispatchCodec
    • combinedCodec

      private final com.mojang.serialization.Codec<com.mojang.datafixers.util.Either<ICustomHolderSet<E>,com.mojang.datafixers.util.Either<TagKey<E>,List<Holder<E>>>>> combinedCodec
  • Constructor Details

    • HolderSetCodec

      private HolderSetCodec(ResourceKey<? extends Registry<E>> p_206660_, com.mojang.serialization.Codec<Holder<E>> p_206661_, boolean p_206662_)
  • Method Details

    • homogenousList

      private static <E> com.mojang.serialization.Codec<List<Holder<E>>> homogenousList(com.mojang.serialization.Codec<Holder<E>> p_206668_, boolean p_206669_)
    • create

      public static <E> com.mojang.serialization.Codec<HolderSet<E>> create(ResourceKey<? extends Registry<E>> p_206686_, com.mojang.serialization.Codec<Holder<E>> p_206687_, boolean p_206688_)
    • decode

      public <T> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<HolderSet<E>,T>> decode(com.mojang.serialization.DynamicOps<T> p_206696_, T p_206697_)
      Specified by:
      decode in interface com.mojang.serialization.Decoder<E>
    • encode

      public <T> com.mojang.serialization.DataResult<T> encode(HolderSet<E> p_206674_, com.mojang.serialization.DynamicOps<T> p_206675_, T p_206676_)
      Specified by:
      encode in interface com.mojang.serialization.Encoder<E>
    • decodeWithoutRegistry

      private <T> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<HolderSet<E>,T>> decodeWithoutRegistry(com.mojang.serialization.DynamicOps<T> p_206671_, T p_206672_)
    • encodeWithoutRegistry

      private <T> com.mojang.serialization.DataResult<T> encodeWithoutRegistry(HolderSet<E> p_206690_, com.mojang.serialization.DynamicOps<T> p_206691_, T p_206692_)