类 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
    • 构造器详细资料

      • Codecs

        public Codecs()
    • 方法详细资料

      • 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.

        类型参数:
        F - the first type
        S - the second type
        参数:
        first - the first codec
        second - the second codec
        返回:
        the xor codec for the two codecs
        另请参阅:
        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;