feat: better texture for causality anchor

This commit is contained in:
xtex 2023-07-27 20:12:20 +08:00
parent cc360be7c1
commit efade64c0f
Signed by: xtex
GPG Key ID: B918086ED8045B91
2 changed files with 16 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import net.minecraft.core.BlockPos
import net.minecraft.core.Direction import net.minecraft.core.Direction
import net.minecraft.world.item.context.BlockPlaceContext import net.minecraft.world.item.context.BlockPlaceContext
import net.minecraft.world.level.BlockGetter import net.minecraft.world.level.BlockGetter
import net.minecraft.world.level.Level
import net.minecraft.world.level.LevelAccessor import net.minecraft.world.level.LevelAccessor
import net.minecraft.world.level.block.* import net.minecraft.world.level.block.*
import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.state.BlockState
@ -87,4 +88,19 @@ object CABlock : HorizontalDirectionalBlock(
super.getFluidState(state) 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)
}
}
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 543 B

After

Width:  |  Height:  |  Size: 1.3 KiB