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
official ack
intermediary net/minecraft/class_6898
named net/minecraft/registry/entry/RegistryEntryListCodec
  • 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<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)
     

    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

    • registry

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

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

      private final com.mojang.serialization.Codec<List<RegistryEntry<E>>> directEntryListCodec
      Mappings:
      Namespace Name Mixin selector
      official c Lack;c:Lcom/mojang/serialization/Codec;
      intermediary field_36482 Lnet/minecraft/class_6898;field_36482:Lcom/mojang/serialization/Codec;
      named directEntryListCodec Lnet/minecraft/registry/entry/RegistryEntryListCodec;directEntryListCodec: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
      official d Lack;d:Lcom/mojang/serialization/Codec;
      intermediary field_36483 Lnet/minecraft/class_6898;field_36483:Lcom/mojang/serialization/Codec;
      named entryListStorageCodec Lnet/minecraft/registry/entry/RegistryEntryListCodec;entryListStorageCodec: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
      official <init> Lack;<init>(Lacp;Lcom/mojang/serialization/Codec;Z)V
      intermediary <init> Lnet/minecraft/class_6898;<init>(Lnet/minecraft/class_5321;Lcom/mojang/serialization/Codec;Z)V
      named <init> Lnet/minecraft/registry/entry/RegistryEntryListCodec;<init>(Lnet/minecraft/registry/RegistryKey;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
      official a Lack;a(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;
      named createDirectEntryListCodec Lnet/minecraft/registry/entry/RegistryEntryListCodec;createDirectEntryListCodec(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
      official a Lack;a(Lacp;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;
      named create Lnet/minecraft/registry/entry/RegistryEntryListCodec;create(Lnet/minecraft/registry/RegistryKey;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
      official decode Lack;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;
      named decode Lnet/minecraft/registry/entry/RegistryEntryListCodec;decode(Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)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
      official a Lack;a(Lhi;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;
      named encode Lnet/minecraft/registry/entry/RegistryEntryListCodec;encode(Lnet/minecraft/registry/entry/RegistryEntryList;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
      official a Lack;a(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;
      named decodeDirect Lnet/minecraft/registry/entry/RegistryEntryListCodec;decodeDirect(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
      official b Lack;b(Lhi;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;
      named encodeDirect Lnet/minecraft/registry/entry/RegistryEntryListCodec;encodeDirect(Lnet/minecraft/registry/entry/RegistryEntryList;Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;