Skip to content

NeoForgeConditionCodec

class NeoForgeConditionCodec(codec: MapCodec<out IACondition>) : MapCodec<NeoForgeCondition> 

Adapts a MapCodec of ArchieCondition to one producing/consuming NeoForgeCondition wrappers.

Constructors

NeoForgeConditionCodec

constructor(codec: MapCodec<out IACondition>)

Properties

neoforge

Wraps this condition as a NeoForge ICondition. Public so archie-datagen can attach conditions to generated recipes.

val MapCodec<out IACondition>.neoforge: MapCodec<NeoForgeCondition>

Wraps this codec as a NeoForge condition-serializer codec.

Functions

ap

open fun <E : Any?> ap(decoder: MapDecoder<Function<in NeoForgeCondition?, out E?>?>?): MapDecoder<E?>?

codec

open fun codec(): Codec<NeoForgeCondition?>?

comap

open fun <B : Any?> comap(function: Function<in B?, out NeoForgeCondition?>?): MapEncoder<B?>?

compressedBuilder

open fun <T : Any?> compressedBuilder(ops: DynamicOps<T?>?): RecordBuilder<T?>?

compressedDecode

open fun <T : Any?> compressedDecode(ops: DynamicOps<T?>?, input: T?): DataResult<NeoForgeCondition?>?

compressor

open fun <T : Any?> compressor(ops: DynamicOps<T?>?): KeyCompressor<T?>?

decode

open override fun <T> decode(ops: DynamicOps<T>, input: MapLike<T>): DataResult<NeoForgeCondition>

decoder

open fun decoder(): Decoder<NeoForgeCondition?>?

dependent

open fun <E : Any?> dependent(
    initialInstance: MapCodec<E?>?, 
    splitter: Function<NeoForgeCondition?, Pair<E?, MapCodec<E?>?>?>?, 
    combiner: BiFunction<NeoForgeCondition?, E?, NeoForgeCondition?>?
): MapCodec<NeoForgeCondition?>?

deprecated

open fun deprecated(since: Int): MapCodec<NeoForgeCondition?>?

encode

open override fun <T> encode(
    input: NeoForgeCondition, 
    ops: DynamicOps<T>, 
    prefix: RecordBuilder<T>
): RecordBuilder<T>

encoder

open fun encoder(): Encoder<NeoForgeCondition?>?

fieldOf

open fun fieldOf(name: String?): MapCodec<NeoForgeCondition?>?

flatComap

open fun <B : Any?> flatComap(function: Function<in B?, out DataResult<out NeoForgeCondition?>?>?): MapEncoder<B?>?

flatMap

open fun <B : Any?> flatMap(function: Function<in NeoForgeCondition?, out DataResult<out B?>?>?): MapDecoder<B?>?

flatXmap

open fun <S : Any?> flatXmap(to: Function<in NeoForgeCondition?, out DataResult<out S?>?>?, from: Function<in S?, out DataResult<out NeoForgeCondition?>?>?): MapCodec<S?>?

forGetter

fun <O : Any?> forGetter(getter: Function<O?, NeoForgeCondition?>?): RecordCodecBuilder<O?, NeoForgeCondition?>?

keys

open override fun <T> keys(ops: DynamicOps<T>): Stream<T>

map

open fun <B : Any?> map(function: Function<in NeoForgeCondition?, out B?>?): MapDecoder<B?>?

mapResult

open fun mapResult(function: MapCodec.ResultFunction<NeoForgeCondition?>?): MapCodec<NeoForgeCondition?>?

orElse

open fun orElse(value: NeoForgeCondition?): MapCodec<NeoForgeCondition?>?
open fun orElse(onError: Consumer<String?>?, value: NeoForgeCondition?): MapCodec<NeoForgeCondition?>?
open fun orElse(onError: UnaryOperator<String?>?, value: NeoForgeCondition?): MapCodec<NeoForgeCondition?>?

orElseGet

open fun orElseGet(value: Supplier<out NeoForgeCondition?>?): MapCodec<NeoForgeCondition?>?
open fun orElseGet(onError: Consumer<String?>?, value: Supplier<out NeoForgeCondition?>?): MapCodec<NeoForgeCondition?>?
open fun orElseGet(onError: UnaryOperator<String?>?, value: Supplier<out NeoForgeCondition?>?): MapCodec<NeoForgeCondition?>?

setPartial

open fun setPartial(value: Supplier<NeoForgeCondition?>?): MapCodec<NeoForgeCondition?>?

stable

open fun stable(): MapCodec<NeoForgeCondition?>?

validate

open fun validate(checker: Function<NeoForgeCondition?, DataResult<NeoForgeCondition?>?>?): MapCodec<NeoForgeCondition?>?

withLifecycle

open fun withLifecycle(lifecycle: Lifecycle?): MapCodec<NeoForgeCondition?>?

xmap

open fun <S : Any?> xmap(to: Function<in NeoForgeCondition?, out S?>?, from: Function<in S?, out NeoForgeCondition?>?): MapCodec<S?>?