Skip to content

Commit

Permalink
Vertical threshold switch redstone fix
Browse files Browse the repository at this point in the history
- Fix vertical threshold switches outputting redstone signal from wrong
sides
  • Loading branch information
PepperCode1 committed Oct 29, 2023
1 parent 8bf42ff commit 2cf7d17
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private void updateObservedInventory(BlockState state, LevelReader world, BlockP

@Override
public boolean canConnectRedstone(BlockState state, BlockGetter world, BlockPos pos, Direction side) {
return side != null && side.getOpposite() != state.getValue(FACING);
return side != null && side.getOpposite() != getTargetDirection(state);
}

@Override
Expand All @@ -66,7 +66,7 @@ public boolean isSignalSource(BlockState state) {

@Override
public int getSignal(BlockState blockState, BlockGetter blockAccess, BlockPos pos, Direction side) {
if (side == blockState.getValue(FACING)
if (side == getTargetDirection(blockState)
.getOpposite())
return 0;
return getBlockEntityOptional(blockAccess, pos).filter(ThresholdSwitchBlockEntity::isPowered)
Expand Down

0 comments on commit 2cf7d17

Please sign in to comment.