Skip to content

net.kernelpanicsoft.archie.data.common.conditions

Types

AAndCondition

data class AAndCondition(val children: List<IACondition>) : AGroupCondition

Condition that holds only when every one of children holds (logical AND).

ABuiltinConditions

Registers Archie's built-in IACondition types (logical combinators + AModLoadedCondition/ARegistryCondition/APlatformCondition) so their codecs can decode from datapacks.

AConditionsPlatform

expect object AConditionsPlatform

Cross-loader hooks that plug IACondition into each loader's native datapack condition system, since Fabric and NeoForge each have their own recipe/tag condition machinery.

AEqualsCondition

data class AEqualsCondition(val children: List<IACondition>) : AGroupCondition

Condition that folds children's results pairwise with == (holds when they agree).

AFalseCondition

Condition that never holds.

AGroupCondition

abstract class AGroupCondition : IACondition

Base for IAConditions that combine children pairwise via reducer, e.g. AAndCondition, AOrCondition, AXorCondition. children must be non-empty.

AModLoadedCondition

data class AModLoadedCondition(val mods: List<String>) : IACondition

Condition that holds when every mod id in mods is loaded, per Platform.isModLoaded.

ANotCondition

data class ANotCondition(val child: IACondition) : IACondition

Condition that inverts the result of child (logical NOT).

AOrCondition

data class AOrCondition(val children: List<IACondition>) : AGroupCondition

Condition that holds when at least one of children holds (logical OR).

APlatformCondition

data class APlatformCondition(val platform: String) : IACondition

Condition that holds when the running loader's APlatform.platform id equals platform.

ARegistryCondition

data class ARegistryCondition(registry: @Serializable



(with = ResourceLocationSerializer::class) ResourceLocation, entries: List<@Serializable



(with = ResourceLocationSerializer::class) ResourceLocation>) : IACondition

Condition that holds when every id in entries is registered in the registry keyed by registry.

ATrueCondition

data object ATrueCondition : IACondition

Condition that always holds.

AXorCondition

data class AXorCondition(val children: List<IACondition>) : AGroupCondition

Condition that holds when an odd number of children hold (logical XOR, folded pairwise).

IACondition

interface IACondition

A cross-loader condition, evaluated at datapack load time, that decides whether the entry it's attached to (a recipe, tag entry, etc.) should be active. Mirrors NeoForge's/Fabric's native condition systems but is decoded through CODEC so the same condition classes work on both loaders.

NeoForgeCondition

class NeoForgeCondition(val condition: IACondition) : ICondition

Adapts an ArchieCondition to NeoForge's ICondition interface, delegating test to it and codec to the registered serializer.

NeoForgeConditionCodec

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

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

Properties