diff --git a/core/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectAddHolderInRadius.kt b/core/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectAddHolderInRadius.kt index f1e4135e..85290efc 100644 --- a/core/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectAddHolderInRadius.kt +++ b/core/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectAddHolderInRadius.kt @@ -42,6 +42,8 @@ object EffectAddHolderInRadius : Effect("add_holder_in_radius") init { registerGenericHolderProvider { dispatcher -> + if (holders.isEmpty()) return@registerGenericHolderProvider emptyList() + nearbyCache.get(dispatcher.uuid) { _ -> holders.filter { it.canApplyTo(dispatcher) } .map { SimpleProvidedHolder(it.holder) } diff --git a/core/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectAddPermanentHolderInRadius.kt b/core/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectAddPermanentHolderInRadius.kt index 4fc01fd4..637c6cb3 100644 --- a/core/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectAddPermanentHolderInRadius.kt +++ b/core/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectAddPermanentHolderInRadius.kt @@ -35,6 +35,8 @@ object EffectAddPermanentHolderInRadius : Effect("add_permanent_ init { registerGenericHolderProvider { dispatcher -> + if (holders.isEmpty()) return@registerGenericHolderProvider emptyList() + nearbyCache.get(dispatcher.uuid) { _ -> holders.filter { it.canApplyTo(dispatcher) } .map { SimpleProvidedHolder(it.holder) }