Class NeoForgeExtraCodecs.AlternativeMapCodec<T>

java.lang.Object
com.mojang.serialization.CompressorHolder
com.mojang.serialization.MapCodec<T>
net.neoforged.neoforge.common.util.NeoForgeExtraCodecs.AlternativeMapCodec<T>
All Implemented Interfaces:
com.mojang.serialization.Compressable, com.mojang.serialization.Keyable, com.mojang.serialization.MapDecoder<T>, com.mojang.serialization.MapEncoder<T>
Enclosing class:
NeoForgeExtraCodecs

private static class NeoForgeExtraCodecs.AlternativeMapCodec<T> extends com.mojang.serialization.MapCodec<T>
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.mojang.serialization.MapCodec

    com.mojang.serialization.MapCodec.MapCodecCodec<A>, com.mojang.serialization.MapCodec.ResultFunction<A>

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

    com.mojang.serialization.MapDecoder.Implementation<A>

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

    com.mojang.serialization.MapEncoder.Implementation<A>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final com.mojang.serialization.MapCodec<T>
     
    private final com.mojang.serialization.MapCodec<T>
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    AlternativeMapCodec(com.mojang.serialization.MapCodec<T> codec, com.mojang.serialization.MapCodec<T> alternative)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    <T1> com.mojang.serialization.DataResult<T>
    decode(com.mojang.serialization.DynamicOps<T1> ops, com.mojang.serialization.MapLike<T1> input)
     
    <T1> com.mojang.serialization.RecordBuilder<T1>
    encode(T input, com.mojang.serialization.DynamicOps<T1> ops, com.mojang.serialization.RecordBuilder<T1> prefix)
     
    <T> Stream<T>
    keys(com.mojang.serialization.DynamicOps<T> ops)
     
     

    Methods inherited from class com.mojang.serialization.MapCodec

    assumeMapUnsafe, codec, dependent, deprecated, fieldOf, flatXmap, forGetter, mapResult, of, of, orElse, orElse, orElse, orElseGet, orElseGet, orElseGet, recursive, setPartial, stable, unit, unit, validate, withLifecycle, xmap

    Methods inherited from class com.mojang.serialization.CompressorHolder

    compressor

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.mojang.serialization.MapDecoder

    ap, compressedDecode, compressor, decoder, flatMap, map

    Methods inherited from interface com.mojang.serialization.MapEncoder

    comap, compressedBuilder, compressor, encoder, flatComap
  • Field Details

    • codec

      private final com.mojang.serialization.MapCodec<T> codec
    • alternative

      private final com.mojang.serialization.MapCodec<T> alternative
  • Constructor Details

    • AlternativeMapCodec

      private AlternativeMapCodec(com.mojang.serialization.MapCodec<T> codec, com.mojang.serialization.MapCodec<T> alternative)
  • Method Details

    • keys

      public <T> Stream<T> keys(com.mojang.serialization.DynamicOps<T> ops)
      Specified by:
      keys in interface com.mojang.serialization.Keyable
      Specified by:
      keys in class com.mojang.serialization.MapCodec<T>
    • decode

      public <T1> com.mojang.serialization.DataResult<T> decode(com.mojang.serialization.DynamicOps<T1> ops, com.mojang.serialization.MapLike<T1> input)
    • encode

      public <T1> com.mojang.serialization.RecordBuilder<T1> encode(T input, com.mojang.serialization.DynamicOps<T1> ops, com.mojang.serialization.RecordBuilder<T1> prefix)
    • toString

      public String toString()
      Overrides:
      toString in class Object