diff --git a/core/src/main/kotlin/com/willfp/libreforge/conditions/ConditionBlock.kt b/core/src/main/kotlin/com/willfp/libreforge/conditions/ConditionBlock.kt index b7a855fa9..baa622a78 100644 --- a/core/src/main/kotlin/com/willfp/libreforge/conditions/ConditionBlock.kt +++ b/core/src/main/kotlin/com/willfp/libreforge/conditions/ConditionBlock.kt @@ -6,6 +6,7 @@ import com.willfp.libreforge.Compiled import com.willfp.libreforge.EmptyProvidedHolder import com.willfp.libreforge.ProvidedHolder import com.willfp.libreforge.applyHolder +import com.willfp.libreforge.effects.Chain import com.willfp.libreforge.effects.EffectList import org.bukkit.Bukkit import org.bukkit.entity.Player @@ -19,7 +20,7 @@ class ConditionBlock internal constructor( val condition: Condition, override val config: Config, override val compileData: T, - val notMetEffects: EffectList, + val notMetEffects: Chain?, val notMetLines: List, val showNotMet: Boolean, val isInverted: Boolean diff --git a/core/src/main/kotlin/com/willfp/libreforge/conditions/ConditionList.kt b/core/src/main/kotlin/com/willfp/libreforge/conditions/ConditionList.kt index 8be2487f8..784641bf9 100644 --- a/core/src/main/kotlin/com/willfp/libreforge/conditions/ConditionList.kt +++ b/core/src/main/kotlin/com/willfp/libreforge/conditions/ConditionList.kt @@ -29,7 +29,7 @@ class ConditionList( return true } - notMet.forEach { it.notMetEffects.trigger(trigger) } + notMet.forEach { it.notMetEffects?.trigger(trigger) } } .let { false } diff --git a/core/src/main/kotlin/com/willfp/libreforge/conditions/Conditions.kt b/core/src/main/kotlin/com/willfp/libreforge/conditions/Conditions.kt index fee9a6599..5d5a1c79a 100644 --- a/core/src/main/kotlin/com/willfp/libreforge/conditions/Conditions.kt +++ b/core/src/main/kotlin/com/willfp/libreforge/conditions/Conditions.kt @@ -64,7 +64,9 @@ import com.willfp.libreforge.integrations.paper.impl.ConditionInRain import com.willfp.libreforge.integrations.paper.impl.ConditionInBubble import com.willfp.libreforge.integrations.paper.impl.ConditionInLava import com.willfp.libreforge.conditions.impl.ConditionOnGround +import com.willfp.libreforge.effects.Chain import com.willfp.libreforge.effects.Effects +import com.willfp.libreforge.effects.executors.impl.NormalExecutorFactory import com.willfp.libreforge.separatorAmbivalent object Conditions : Registry>() { @@ -98,11 +100,18 @@ object Conditions : Registry>() { return null } - return makeBlock(condition, config.getSubsection("args"), context.with("args")) + val notMetEffects = Effects.compileChain( + config.getSubsections("not-met-effects"), + NormalExecutorFactory.create(), + context.with("not-met-effects") + ) + + return makeBlock(condition, notMetEffects, config.getSubsection("args"), context.with("args")) } private fun makeBlock( condition: Condition, + notMetEffects: Chain?, config: Config, context: ViolationContext ): ConditionBlock? { @@ -112,11 +121,6 @@ object Conditions : Registry>() { val compileData = condition.makeCompileData(config, context) - val notMetEffects = Effects.compile( - config.getSubsections("not-met-effects"), - context.with("not-met-effects") - ) - return ConditionBlock( condition, config,