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 agh
intermediary net/minecraft/class_5699
named net/minecraft/util/dynamic/Codecs
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
Codecs.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 forEither
instances.
-
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 forEither
instances.This returned codec fails if both the
first
andsecond
codecs can decode the input, while DFU'sEitherCodec
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 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 a
Lagh;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;
-