From ed6776f9dffd2becb8b177e68f981af3b23ae049 Mon Sep 17 00:00:00 2001 From: xtex Date: Tue, 4 Jul 2023 16:28:42 +0800 Subject: [PATCH] feat: extra swarm spawn check --- .../kotlin/quaedam/projection/swarm/SwarmProjectionEffect.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/src/main/kotlin/quaedam/projection/swarm/SwarmProjectionEffect.kt b/common/src/main/kotlin/quaedam/projection/swarm/SwarmProjectionEffect.kt index ec3b66d..2296ac4 100644 --- a/common/src/main/kotlin/quaedam/projection/swarm/SwarmProjectionEffect.kt +++ b/common/src/main/kotlin/quaedam/projection/swarm/SwarmProjectionEffect.kt @@ -40,6 +40,10 @@ data class SwarmProjectionEffect( level.random.nextInt(area.minZ(), area.maxZ()), ) spawnPos = spawnPos.atY(level.getHeight(Heightmap.Types.WORLD_SURFACE, spawnPos.x, spawnPos.z)) + if (level.getBlockState(spawnPos.below()).isAir) + return + if (!level.getBlockState(spawnPos).isAir) + return ProjectedPersonEntity.entity.get().spawn(level, spawnPos, MobSpawnType.TRIGGERED) } }