Spikes no longer pop off of honey blocks

This commit is contained in:
Sollace 2023-10-15 23:50:48 +01:00
parent 9b94662f9b
commit 3e9a0df7a1
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -60,7 +60,7 @@ public class SpikesBlock extends OrientedBlock {
Direction facing = state.get(FACING);
pos = pos.offset(facing.getOpposite());
state = world.getBlockState(pos);
return state.isReplaceable() || state.isSideSolid(world, pos, facing, SideShapeType.FULL);
return state.isReplaceable() || state.isSideSolid(world, pos, facing, SideShapeType.FULL) || state.isOf(Blocks.HONEY_BLOCK);
}
@Override
@ -72,8 +72,7 @@ public class SpikesBlock extends OrientedBlock {
@Deprecated
@Override
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) {
if (direction == state.get(FACING).getOpposite() && !neighborState.isSideSolid(world, neighborPos, direction, SideShapeType.FULL)) {
if (direction == state.get(FACING).getOpposite() && !canPlaceAt(state, world, pos)) {
if (!(neighborState.isOf(Blocks.STICKY_PISTON)
|| neighborState.isOf(Blocks.PISTON)
|| neighborState.isOf(Blocks.PISTON_HEAD)