From 3cab891af06cbab5f18bd779c6d533d48a224a86 Mon Sep 17 00:00:00 2001 From: xtex Date: Fri, 28 Jul 2023 10:00:13 +0800 Subject: [PATCH] feat: disable causality anchor in water --- common/src/main/kotlin/quaedam/misc/causality/CABlock.kt | 1 - .../src/main/kotlin/quaedam/misc/causality/CausalityAnchor.kt | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/main/kotlin/quaedam/misc/causality/CABlock.kt b/common/src/main/kotlin/quaedam/misc/causality/CABlock.kt index 8b58ddc..cd6f2d6 100644 --- a/common/src/main/kotlin/quaedam/misc/causality/CABlock.kt +++ b/common/src/main/kotlin/quaedam/misc/causality/CABlock.kt @@ -19,7 +19,6 @@ import net.minecraft.world.phys.shapes.VoxelShape object CABlock : HorizontalDirectionalBlock( Properties.of() - .lightLevel { 2 } .noOcclusion() .strength(2f) .requiresCorrectToolForDrops() diff --git a/common/src/main/kotlin/quaedam/misc/causality/CausalityAnchor.kt b/common/src/main/kotlin/quaedam/misc/causality/CausalityAnchor.kt index 86e7a05..83ba1ed 100644 --- a/common/src/main/kotlin/quaedam/misc/causality/CausalityAnchor.kt +++ b/common/src/main/kotlin/quaedam/misc/causality/CausalityAnchor.kt @@ -5,6 +5,7 @@ import net.minecraft.world.item.BlockItem import net.minecraft.world.item.Item import net.minecraft.world.level.Level import net.minecraft.world.level.block.entity.BlockEntityType +import net.minecraft.world.level.block.state.properties.BlockStateProperties import quaedam.Quaedam object CausalityAnchor { @@ -27,6 +28,6 @@ object CausalityAnchor { fun checkEffect(level: Level, pos: BlockPos) = level.getChunkAt(pos) .blockEntities - .any { (_, v) -> v is CABlockEntity } + .any { (k, v) -> v is CABlockEntity && !level.getBlockState(k).getValue(BlockStateProperties.WATERLOGGED) } } \ No newline at end of file