fix: causality anchor on causality anchor

This commit is contained in:
xtex 2023-07-27 20:39:44 +08:00
parent d2b159ade2
commit 73923b9586
Signed by: xtex
GPG Key ID: B918086ED8045B91

View File

@ -44,7 +44,7 @@ object CABlock : HorizontalDirectionalBlock(
}
override fun getStateForPlacement(context: BlockPlaceContext): BlockState? {
if (context.level.getBlockState(context.clickedPos.below()).isAir) return null
if (!context.level.getBlockState(context.clickedPos.below()).canOcclude()) return null
return super.defaultBlockState().setValue(FACING, context.horizontalDirection)
}
@ -102,7 +102,7 @@ object CABlock : HorizontalDirectionalBlock(
movedByPiston: Boolean
) {
super.neighborChanged(state, level, pos, neighborBlock, neighborPos, movedByPiston)
if (level.getBlockState(pos.below()).isAir) {
if (!level.getBlockState(pos.below()).canOcclude()) {
level.destroyBlock(pos, true)
}
}