Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
public class ActivatorSlidingRailBlock extends BaseSlidingRailBlock implements IHammerChangeable, IMoveableEntityBlock {
public static final List<Direction> SIGNAL_SOURCE_SIDES = List.of(
Direction.DOWN, Direction.NORTH, Direction.SOUTH, Direction.EAST, Direction.WEST);
public static final List<Direction> 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),
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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
Expand Down