diff --git a/src/main/java/dev/dubhe/anvilcraft/api/sliding/SlidingBlockSection.java b/src/main/java/dev/dubhe/anvilcraft/api/sliding/SlidingBlockSection.java index bd2a88151..eb205671f 100644 --- a/src/main/java/dev/dubhe/anvilcraft/api/sliding/SlidingBlockSection.java +++ b/src/main/java/dev/dubhe/anvilcraft/api/sliding/SlidingBlockSection.java @@ -132,7 +132,8 @@ public void setBlock(Level level, BlockPos center, Entity entity) { Block.dropResources(state, level, pos); continue; } - if (level.getFluidState(pos).getType() == Fluids.WATER) { + if (level.getFluidState(pos).getType() == Fluids.WATER + && state.hasProperty(BlockStateProperties.WATERLOGGED)) { state = state.setValue(BlockStateProperties.WATERLOGGED, true); } diff --git a/src/main/java/dev/dubhe/anvilcraft/block/sliding/ActivatorSlidingRailBlock.java b/src/main/java/dev/dubhe/anvilcraft/block/sliding/ActivatorSlidingRailBlock.java index b62b2745c..904b0fbfc 100644 --- a/src/main/java/dev/dubhe/anvilcraft/block/sliding/ActivatorSlidingRailBlock.java +++ b/src/main/java/dev/dubhe/anvilcraft/block/sliding/ActivatorSlidingRailBlock.java @@ -40,6 +40,8 @@ public class ActivatorSlidingRailBlock extends BaseSlidingRailBlock implements IHammerChangeable, IMoveableEntityBlock { public static final List SIGNAL_SOURCE_SIDES = List.of( Direction.DOWN, Direction.NORTH, Direction.SOUTH, Direction.EAST, Direction.WEST); + public static final List UPDATE_SIDES = List.of( + Direction.UP, Direction.NORTH, Direction.SOUTH, Direction.EAST, Direction.WEST); public static final VoxelShape AABB_X = Stream.of( Block.box(0, 0, 0, 16, 6, 16), Block.box(0, 6, 11, 16, 16, 16), @@ -144,6 +146,7 @@ protected void updatePower(Level level, BlockPos pos, BlockState state, BlockPos boolean shouldPower = this.isPowered(level, pos); if (powered != shouldPower) { level.setBlockAndUpdate(pos, state.setValue(POWERED, shouldPower)); + this.updateAbove(level, pos); } if (powered) { Direction.Axis axis = state.getValue(FACING).getAxis(); @@ -292,10 +295,11 @@ private void updateAbove(Level level, BlockPos pos) { aboveState.onNeighborChange(level, abovePos, pos); level.neighborChanged(aboveState, abovePos, this, pos, false); if (!aboveState.isRedstoneConductor(level, abovePos)) return; - abovePos = abovePos.above(); - aboveState = level.getBlockState(abovePos); - if (!aboveState.getWeakChanges(level, abovePos)) return; - level.neighborChanged(aboveState, abovePos, this, pos, false); + for (Direction dir : UPDATE_SIDES) { + BlockPos neighborPos = abovePos.relative(dir); + BlockState neighborState = level.getBlockState(neighborPos); + level.neighborChanged(neighborState, neighborPos, aboveState.getBlock(), abovePos, false); + } } @Override