From efade64c0f18df68ae7139a689c0e9d7e6942bf5 Mon Sep 17 00:00:00 2001 From: xtex Date: Thu, 27 Jul 2023 20:12:20 +0800 Subject: [PATCH] feat: better texture for causality anchor --- .../kotlin/quaedam/misc/causality/CABlock.kt | 16 ++++++++++++++++ .../textures/block/causality_anchor.png | Bin 543 -> 1320 bytes 2 files changed, 16 insertions(+) diff --git a/common/src/main/kotlin/quaedam/misc/causality/CABlock.kt b/common/src/main/kotlin/quaedam/misc/causality/CABlock.kt index 829a735..39298d6 100644 --- a/common/src/main/kotlin/quaedam/misc/causality/CABlock.kt +++ b/common/src/main/kotlin/quaedam/misc/causality/CABlock.kt @@ -4,6 +4,7 @@ import net.minecraft.core.BlockPos import net.minecraft.core.Direction import net.minecraft.world.item.context.BlockPlaceContext import net.minecraft.world.level.BlockGetter +import net.minecraft.world.level.Level import net.minecraft.world.level.LevelAccessor import net.minecraft.world.level.block.* import net.minecraft.world.level.block.state.BlockState @@ -87,4 +88,19 @@ object CABlock : HorizontalDirectionalBlock( super.getFluidState(state) } + @Suppress("OVERRIDE_DEPRECATION", "DEPRECATION") + override fun neighborChanged( + state: BlockState, + level: Level, + pos: BlockPos, + neighborBlock: Block, + neighborPos: BlockPos, + movedByPiston: Boolean + ) { + super.neighborChanged(state, level, pos, neighborBlock, neighborPos, movedByPiston) + if (level.getBlockState(pos.below()).isAir) { + level.destroyBlock(pos, true) + } + } + } \ No newline at end of file diff --git a/common/src/main/resources/assets/quaedam/textures/block/causality_anchor.png b/common/src/main/resources/assets/quaedam/textures/block/causality_anchor.png index 7d015da71aa80d3f472cd4cc7a94ac206507a878..e48ddfd062346d6d9457ff762005799d67e2d808 100644 GIT binary patch delta 1302 zcmV+x1?l>q1gHv-BYy<%Nkl_Rr0whu79^9Gi zZj5;uFv|QSYj(o;vp8*7Xs7;GsC;WM*Y05p%A zSFhgyu(h+z#q$@~+Sx|)xB&?1I+@ultIK(MqERw4GZi1++0ju|0hKsu1-P05%|Kar z&EqDd>ns=s0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