From d01f7b642ed573c47b6d1d9a6cfeea09b3df987e Mon Sep 17 00:00:00 2001 From: xtex Date: Fri, 28 Jul 2023 16:56:07 +0800 Subject: [PATCH] feat: hide all projection effects in reality stabled area --- .../src/main/kotlin/quaedam/projector/Projector.kt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/common/src/main/kotlin/quaedam/projector/Projector.kt b/common/src/main/kotlin/quaedam/projector/Projector.kt index 891e4eb..081f93c 100644 --- a/common/src/main/kotlin/quaedam/projector/Projector.kt +++ b/common/src/main/kotlin/quaedam/projector/Projector.kt @@ -7,6 +7,7 @@ import net.minecraft.world.level.Level import net.minecraft.world.level.block.entity.BlockEntityType import quaedam.Quaedam import quaedam.config.QuaedamConfig +import quaedam.misc.reality.RealityStabler import quaedam.projection.ProjectionEffect import quaedam.projection.ProjectionEffectType import quaedam.utils.getChunksNearby @@ -40,9 +41,17 @@ object Projector { .toSet() @Suppress("UNCHECKED_CAST") - fun findNearbyProjections(level: Level, pos: BlockPos, type: ProjectionEffectType) = - findNearbyProjectors(level, pos) + fun findNearbyProjections( + level: Level, + pos: BlockPos, + type: ProjectionEffectType + ): List { + if (RealityStabler.checkEffect(level, pos)) { + return emptyList() + } + return findNearbyProjectors(level, pos) .map { level.getBlockEntity(it) as ProjectorBlockEntity } .mapNotNull { it.effects[type] as T? } + } }