Class RegistryEntryListCodec<E>

java.lang.Object
net.minecraft.registry.entry.RegistryEntryListCodec<E>
All Implemented Interfaces:
com.mojang.serialization.Codec<RegistryEntryList<E>>, com.mojang.serialization.Decoder<RegistryEntryList<E>>, com.mojang.serialization.Encoder<RegistryEntryList<E>>

public class RegistryEntryListCodec<E> extends Object implements com.mojang.serialization.Codec<RegistryEntryList<E>>
Mappings:
Namespace Name
named net/minecraft/registry/entry/RegistryEntryListCodec
intermediary net/minecraft/class_6898
official alt
  • Nested Class Summary

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

    com.mojang.serialization.Codec.RecursiveCodec<T>, com.mojang.serialization.Codec.ResultFunction<A>

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

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

    Fields
    Modifier and Type
    Field
    Description
    private final com.mojang.serialization.Codec<List<RegistryEntry<E>>>
     
    private final com.mojang.serialization.Codec<RegistryEntry<E>>
     
    private final com.mojang.serialization.Codec<com.mojang.datafixers.util.Either<TagKey<E>,List<RegistryEntry<E>>>>
     
    private final RegistryKey<? 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
    RegistryEntryListCodec(RegistryKey<? extends Registry<E>> registry, com.mojang.serialization.Codec<RegistryEntry<E>> entryCodec, boolean alwaysSerializeAsList)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <E> com.mojang.serialization.Codec<RegistryEntryList<E>>
    create(RegistryKey<? extends Registry<E>> registryRef, com.mojang.serialization.Codec<RegistryEntry<E>> entryCodec, boolean alwaysSerializeAsList)
     
    private static <E> com.mojang.serialization.Codec<List<RegistryEntry<E>>>
    createDirectEntryListCodec(com.mojang.serialization.Codec<RegistryEntry<E>> entryCodec, boolean alwaysSerializeAsList)
     
    <T> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<RegistryEntryList<E>,T>>
    decode(com.mojang.serialization.DynamicOps<T> ops, T input)
     
    private <T> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<RegistryEntryList<E>,T>>
    decodeDirect(com.mojang.serialization.DynamicOps<T> ops, T input)
     
    <T> com.mojang.serialization.DataResult<T>
    encode(RegistryEntryList<E> registryEntryList, com.mojang.serialization.DynamicOps<T> dynamicOps, T t)
     
    private <T> com.mojang.serialization.DataResult<T>
    encodeDirect(RegistryEntryList<E> entryList, com.mojang.serialization.DynamicOps<T> ops, T prefix)
     
    private static <E> com.mojang.serialization.DataResult<RegistryEntryList<E>>
    get(RegistryEntryLookup<E> registry, TagKey<E> tag)
     

    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, lenientOptionalFieldOf, lenientOptionalFieldOf, lenientOptionalFieldOf, lenientOptionalFieldOf, listOf, listOf, mapResult, optionalFieldOf, optionalFieldOf, optionalFieldOf, optionalFieldOf, orElse, orElse, orElse, orElseGet, orElseGet, orElseGet, partialDispatch, promotePartial, sizeLimitedListOf, stable, validate, 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

    • registry

      private final RegistryKey<? extends Registry<E>> registry
      Mappings:
      Namespace Name Mixin selector
      named registry Lnet/minecraft/registry/entry/RegistryEntryListCodec;registry:Lnet/minecraft/registry/RegistryKey;
      intermediary field_36480 Lnet/minecraft/class_6898;field_36480:Lnet/minecraft/class_5321;
      official a Lalt;a:Laly;
    • entryCodec

      private final com.mojang.serialization.Codec<RegistryEntry<E>> entryCodec
      Mappings:
      Namespace Name Mixin selector
      named entryCodec Lnet/minecraft/registry/entry/RegistryEntryListCodec;entryCodec:Lcom/mojang/serialization/Codec;
      intermediary field_36481 Lnet/minecraft/class_6898;field_36481:Lcom/mojang/serialization/Codec;
      official b Lalt;b:Lcom/mojang/serialization/Codec;
    • directEntryListCodec

      private final com.mojang.serialization.Codec<List<RegistryEntry<E>>> directEntryListCodec
      Mappings:
      Namespace Name Mixin selector
      named directEntryListCodec Lnet/minecraft/registry/entry/RegistryEntryListCodec;directEntryListCodec:Lcom/mojang/serialization/Codec;
      intermediary field_36482 Lnet/minecraft/class_6898;field_36482:Lcom/mojang/serialization/Codec;
      official c Lalt;c:Lcom/mojang/serialization/Codec;
    • entryListStorageCodec

      private final com.mojang.serialization.Codec<com.mojang.datafixers.util.Either<TagKey<E>,List<RegistryEntry<E>>>> entryListStorageCodec
      Mappings:
      Namespace Name Mixin selector
      named entryListStorageCodec Lnet/minecraft/registry/entry/RegistryEntryListCodec;entryListStorageCodec:Lcom/mojang/serialization/Codec;
      intermediary field_36483 Lnet/minecraft/class_6898;field_36483:Lcom/mojang/serialization/Codec;
      official d Lalt;d:Lcom/mojang/serialization/Codec;
  • Constructor Details

    • RegistryEntryListCodec

      private RegistryEntryListCodec(RegistryKey<? extends Registry<E>> registry, com.mojang.serialization.Codec<RegistryEntry<E>> entryCodec, boolean alwaysSerializeAsList)
      Parameters:
      alwaysSerializeAsList - whether to always serialize the list as a list instead of serializing as one entry if the length is 0
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/registry/entry/RegistryEntryListCodec;<init>(Lnet/minecraft/registry/RegistryKey;Lcom/mojang/serialization/Codec;Z)V
      intermediary <init> Lnet/minecraft/class_6898;<init>(Lnet/minecraft/class_5321;Lcom/mojang/serialization/Codec;Z)V
      official <init> Lalt;<init>(Laly;Lcom/mojang/serialization/Codec;Z)V
  • Method Details

    • createDirectEntryListCodec

      private static <E> com.mojang.serialization.Codec<List<RegistryEntry<E>>> createDirectEntryListCodec(com.mojang.serialization.Codec<RegistryEntry<E>> entryCodec, boolean alwaysSerializeAsList)
      Parameters:
      alwaysSerializeAsList - whether to always serialize the list as a list instead of serializing as one entry if the length is 0
      Mappings:
      Namespace Name Mixin selector
      named createDirectEntryListCodec Lnet/minecraft/registry/entry/RegistryEntryListCodec;createDirectEntryListCodec(Lcom/mojang/serialization/Codec;Z)Lcom/mojang/serialization/Codec;
      intermediary method_40382 Lnet/minecraft/class_6898;method_40382(Lcom/mojang/serialization/Codec;Z)Lcom/mojang/serialization/Codec;
      official a Lalt;a(Lcom/mojang/serialization/Codec;Z)Lcom/mojang/serialization/Codec;
    • create

      public static <E> com.mojang.serialization.Codec<RegistryEntryList<E>> create(RegistryKey<? extends Registry<E>> registryRef, com.mojang.serialization.Codec<RegistryEntry<E>> entryCodec, boolean alwaysSerializeAsList)
      Parameters:
      alwaysSerializeAsList - whether to always serialize the list as a list instead of serializing as one entry if the length is 0
      Mappings:
      Namespace Name Mixin selector
      named create Lnet/minecraft/registry/entry/RegistryEntryListCodec;create(Lnet/minecraft/registry/RegistryKey;Lcom/mojang/serialization/Codec;Z)Lcom/mojang/serialization/Codec;
      intermediary method_40388 Lnet/minecraft/class_6898;method_40388(Lnet/minecraft/class_5321;Lcom/mojang/serialization/Codec;Z)Lcom/mojang/serialization/Codec;
      official a Lalt;a(Laly;Lcom/mojang/serialization/Codec;Z)Lcom/mojang/serialization/Codec;
    • decode

      public <T> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<RegistryEntryList<E>,T>> decode(com.mojang.serialization.DynamicOps<T> ops, T input)
      Specified by:
      decode in interface com.mojang.serialization.Decoder<E>
      Mappings:
      Namespace Name Mixin selector
      named decode Lnet/minecraft/registry/entry/RegistryEntryListCodec;decode(Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
      intermediary decode Lnet/minecraft/class_6898;decode(Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
      official decode Lalt;decode(Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
    • get

      private static <E> com.mojang.serialization.DataResult<RegistryEntryList<E>> get(RegistryEntryLookup<E> registry, TagKey<E> tag)
      Mappings:
      Namespace Name Mixin selector
      named get Lnet/minecraft/registry/entry/RegistryEntryListCodec;get(Lnet/minecraft/registry/RegistryEntryLookup;Lnet/minecraft/registry/tag/TagKey;)Lcom/mojang/serialization/DataResult;
      intermediary method_58029 Lnet/minecraft/class_6898;method_58029(Lnet/minecraft/class_7871;Lnet/minecraft/class_6862;)Lcom/mojang/serialization/DataResult;
      official a Lalt;a(Ljr;Layk;)Lcom/mojang/serialization/DataResult;
    • encode

      public <T> com.mojang.serialization.DataResult<T> encode(RegistryEntryList<E> registryEntryList, com.mojang.serialization.DynamicOps<T> dynamicOps, T t)
      Specified by:
      encode in interface com.mojang.serialization.Encoder<E>
      Mappings:
      Namespace Name Mixin selector
      named encode Lnet/minecraft/registry/entry/RegistryEntryListCodec;encode(Lnet/minecraft/registry/entry/RegistryEntryList;Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
      intermediary method_40384 Lnet/minecraft/class_6898;method_40384(Lnet/minecraft/class_6885;Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
      official a Lalt;a(Lju;Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
    • decodeDirect

      private <T> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<RegistryEntryList<E>,T>> decodeDirect(com.mojang.serialization.DynamicOps<T> ops, T input)
      Mappings:
      Namespace Name Mixin selector
      named decodeDirect Lnet/minecraft/registry/entry/RegistryEntryListCodec;decodeDirect(Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
      intermediary method_40383 Lnet/minecraft/class_6898;method_40383(Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
      official a Lalt;a(Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
    • encodeDirect

      private <T> com.mojang.serialization.DataResult<T> encodeDirect(RegistryEntryList<E> entryList, com.mojang.serialization.DynamicOps<T> ops, T prefix)
      Mappings:
      Namespace Name Mixin selector
      named encodeDirect Lnet/minecraft/registry/entry/RegistryEntryListCodec;encodeDirect(Lnet/minecraft/registry/entry/RegistryEntryList;Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
      intermediary method_40389 Lnet/minecraft/class_6898;method_40389(Lnet/minecraft/class_6885;Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
      official b Lalt;b(Lju;Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;