mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-14 06:24:29 +01:00
Vertical threshold switch redstone fix
- Fix vertical threshold switches outputting redstone signal from wrong sides
This commit is contained in:
parent
8bf42ffa6f
commit
2cf7d171df
@ -56,7 +56,7 @@ public class ThresholdSwitchBlock extends DirectedDirectionalBlock implements IB
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canConnectRedstone(BlockState state, BlockGetter world, BlockPos pos, Direction side) {
|
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
|
@Override
|
||||||
@ -66,7 +66,7 @@ public class ThresholdSwitchBlock extends DirectedDirectionalBlock implements IB
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getSignal(BlockState blockState, BlockGetter blockAccess, BlockPos pos, Direction side) {
|
public int getSignal(BlockState blockState, BlockGetter blockAccess, BlockPos pos, Direction side) {
|
||||||
if (side == blockState.getValue(FACING)
|
if (side == getTargetDirection(blockState)
|
||||||
.getOpposite())
|
.getOpposite())
|
||||||
return 0;
|
return 0;
|
||||||
return getBlockEntityOptional(blockAccess, pos).filter(ThresholdSwitchBlockEntity::isPowered)
|
return getBlockEntityOptional(blockAccess, pos).filter(ThresholdSwitchBlockEntity::isPowered)
|
||||||
|
Loading…
Reference in New Issue
Block a user