Class Codecs

java.lang.Object
net.minecraft.util.dynamic.Codecs

public class Codecs extends Object
A few extensions for Codec or DynamicOps.

Expect its removal once Mojang updates DataFixerUpper.

Mappings:
Namespace Name
official agp
intermediary net/minecraft/class_5699
named net/minecraft/util/dynamic/Codecs
  • Field Details

    • field_33441

      public static final com.mojang.serialization.Codec<Integer> field_33441
      Mappings:
      Namespace Name Mixin selector
      official a Lagp;a:Lcom/mojang/serialization/Codec;
      intermediary field_33441 Lnet/minecraft/class_5699;field_33441:Lcom/mojang/serialization/Codec;
      named field_33441 Lnet/minecraft/util/dynamic/Codecs;field_33441:Lcom/mojang/serialization/Codec;
    • field_33442

      public static final com.mojang.serialization.Codec<Integer> field_33442
      Mappings:
      Namespace Name Mixin selector
      official b Lagp;b:Lcom/mojang/serialization/Codec;
      intermediary field_33442 Lnet/minecraft/class_5699;field_33442:Lcom/mojang/serialization/Codec;
      named field_33442 Lnet/minecraft/util/dynamic/Codecs;field_33442:Lcom/mojang/serialization/Codec;
  • Constructor Details

    • Codecs

      public Codecs()
  • Method Details

    • xor

      public static <F, S> com.mojang.serialization.Codec<com.mojang.datafixers.util.Either<F,S>> xor(com.mojang.serialization.Codec<F> first, com.mojang.serialization.Codec<S> second)
      Returns an exclusive-or codec for Either instances.

      This returned codec fails if both the first and second codecs can decode the input, while DFU's EitherCodec will always take the first decoded result when it is available.

      Otherwise, this behaves the same as the either codec.

      Type Parameters:
      F - the first type
      S - the second type
      Parameters:
      first - the first codec
      second - the second codec
      Returns:
      the xor codec for the two codecs
      See Also:
      • Codec.either(Codec, Codec)
      • EitherCodec
      Mappings:
      Namespace Name Mixin selector
      official a Lagp;a(Lcom/mojang/serialization/Codec;Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec;
      intermediary method_33817 Lnet/minecraft/class_5699;method_33817(Lcom/mojang/serialization/Codec;Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec;
      named xor Lnet/minecraft/util/dynamic/Codecs;xor(Lcom/mojang/serialization/Codec;Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec;
    • method_36243

      private static <N extends Number & Comparable<N>> Function<N,com.mojang.serialization.DataResult<N>> method_36243(N n, N n2, Function<N,String> function)
      Mappings:
      Namespace Name Mixin selector
      official a Lagp;a(Ljava/lang/Number;Ljava/lang/Number;Ljava/util/function/Function;)Ljava/util/function/Function;
      intermediary method_36243 Lnet/minecraft/class_5699;method_36243(Ljava/lang/Number;Ljava/lang/Number;Ljava/util/function/Function;)Ljava/util/function/Function;
      named method_36243 Lnet/minecraft/util/dynamic/Codecs;method_36243(Ljava/lang/Number;Ljava/lang/Number;Ljava/util/function/Function;)Ljava/util/function/Function;
    • method_36241

      private static com.mojang.serialization.Codec<Integer> method_36241(int int2, int int3, Function<Integer,String> function)
      Mappings:
      Namespace Name Mixin selector
      official a Lagp;a(IILjava/util/function/Function;)Lcom/mojang/serialization/Codec;
      intermediary method_36241 Lnet/minecraft/class_5699;method_36241(IILjava/util/function/Function;)Lcom/mojang/serialization/Codec;
      named method_36241 Lnet/minecraft/util/dynamic/Codecs;method_36241(IILjava/util/function/Function;)Lcom/mojang/serialization/Codec;
    • method_36240

      public static <T> Function<List<T>,com.mojang.serialization.DataResult<List<T>>> method_36240()
      Mappings:
      Namespace Name Mixin selector
      official a Lagp;a()Ljava/util/function/Function;
      intermediary method_36240 Lnet/minecraft/class_5699;method_36240()Ljava/util/function/Function;
      named method_36240 Lnet/minecraft/util/dynamic/Codecs;method_36240()Ljava/util/function/Function;
    • method_36973

      public static <T> com.mojang.serialization.Codec<List<T>> method_36973(com.mojang.serialization.Codec<List<T>> codec)
      Mappings:
      Namespace Name Mixin selector
      official a Lagp;a(Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec;
      intermediary method_36973 Lnet/minecraft/class_5699;method_36973(Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec;
      named method_36973 Lnet/minecraft/util/dynamic/Codecs;method_36973(Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec;
    • method_37351

      public static <T> Function<List<Supplier<T>>,com.mojang.serialization.DataResult<List<Supplier<T>>>> method_37351()
      Mappings:
      Namespace Name Mixin selector
      official b Lagp;b()Ljava/util/function/Function;
      intermediary method_37351 Lnet/minecraft/class_5699;method_37351()Ljava/util/function/Function;
      named method_37351 Lnet/minecraft/util/dynamic/Codecs;method_37351()Ljava/util/function/Function;
    • method_37352

      public static <T> Function<Supplier<T>,com.mojang.serialization.DataResult<Supplier<T>>> method_37352()
      Mappings:
      Namespace Name Mixin selector
      official c Lagp;c()Ljava/util/function/Function;
      intermediary method_37352 Lnet/minecraft/class_5699;method_37352()Ljava/util/function/Function;
      named method_37352 Lnet/minecraft/util/dynamic/Codecs;method_37352()Ljava/util/function/Function;