Package net.minecraft.util.dynamic
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 aghintermediary net/minecraft/class_5699named net/minecraft/util/dynamic/Codecs
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classCodecs.Xor<F,S> -
Constructor Summary
Constructors Constructor Description Codecs() -
Method Summary
Modifier and Type Method Description 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 forEitherinstances.
-
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 forEitherinstances.This returned codec fails if both the
firstandsecondcodecs can decode the input, while DFU'sEitherCodecwill always take the first decoded result when it is available.Otherwise, this behaves the same as the either codec.
- Type Parameters:
F- the first typeS- the second type- Parameters:
first- the first codecsecond- the second codec- Returns:
- the xor codec for the two codecs
- See Also:
Codec.either(Codec, Codec),EitherCodec- Mappings:
Namespace Name Mixin selector official aLagh;a(Lcom/mojang/serialization/Codec;Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec;intermediary method_33817Lnet/minecraft/class_5699;method_33817(Lcom/mojang/serialization/Codec;Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec;named xorLnet/minecraft/util/dynamic/Codecs;xor(Lcom/mojang/serialization/Codec;Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec;
-