diff --git a/core/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectAOE.kt b/core/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectAOE.kt index 365c2ad46..2adb40b59 100644 --- a/core/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectAOE.kt +++ b/core/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectAOE.kt @@ -26,10 +26,21 @@ object EffectAOE : Effect("aoe") { } override fun onTrigger(config: Config, data: TriggerData, compileData: AOECompileData): Boolean { - val location = data.dispatcher.get()?.eyeLocation - ?: data.dispatcher.location + val location = data.location?.clone() + ?: data.dispatcher.location?.clone() ?: return false + val dispatcherLocation = data.dispatcher.location + + if (dispatcherLocation != null) { + if (location.world == dispatcherLocation.world + && location.distanceSquared(dispatcherLocation) <= 1.0 + ) { + location.add(0.0, data.dispatcher.get()?.eyeHeight ?: 0.0, 0.0) + location.direction = dispatcherLocation.direction + } + } + val shape = compileData.shape ?: return false for (entity in shape.getEntities( diff --git a/core/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectAOEBlocks.kt b/core/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectAOEBlocks.kt index aa5342bcd..4b0fb44f7 100644 --- a/core/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectAOEBlocks.kt +++ b/core/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectAOEBlocks.kt @@ -24,10 +24,21 @@ object EffectAOEBlocks : Effect("aoe_blocks") { } override fun onTrigger(config: Config, data: TriggerData, compileData: AOECompileData): Boolean { - val location = data.dispatcher.get()?.eyeLocation - ?: data.dispatcher.location + val location = data.location?.clone() + ?: data.dispatcher.location?.clone() ?: return false + val dispatcherLocation = data.dispatcher.location + + if (dispatcherLocation != null) { + if (location.world == dispatcherLocation.world + && location.distanceSquared(dispatcherLocation) <= 1.0 + ) { + location.add(0.0, data.dispatcher.get()?.eyeHeight ?: 0.0, 0.0) + location.direction = dispatcherLocation.direction + } + } + val shape = compileData.shape ?: return false for (block in shape.getBlocks(