Skip to content

Commit

Permalink
Update BlockHighSpeedRepeater.java
Browse files Browse the repository at this point in the history
  • Loading branch information
ZiYueCommentary committed Sep 19, 2024
1 parent 6b11d51 commit ac39f93
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ protected void updateTarget(World world, BlockPos pos, BlockState state) {

@Override
public BlockState getPlacementState2(ItemPlacementContext ctx) {
BlockState state = getDefaultState2().with(new Property<>(FACING.data), ctx.getPlayerFacing().getOpposite().data).with(new Property<>(POWERED.data), false);
final Direction direction = ctx.getPlayerFacing().getOpposite();
final BlockPos blockPos = ctx.getBlockPos().offset(direction);
final boolean powered = ctx.getWorld().getBlockState(blockPos).getStrongRedstonePower(new BlockView(ctx.getWorld().data), blockPos, direction) > 0;
final BlockState state = getDefaultState2().with(new Property<>(FACING.data), direction.data).with(new Property<>(POWERED.data), powered);
return state.with(new Property<>(LOCKED.data), this.isLocked(ctx.getWorld(), ctx.getBlockPos(), state));
}

Expand Down

0 comments on commit ac39f93

Please sign in to comment.