Very very weird bug i've found. Everything is on the screenshot. The strength of the signal must be 1. I've placed some similar circuits to show the difference and demonstrate the bug better.
Code analysis
Related issues
is duplicated by
relates to
Attachments
Comments

Can confirm: if you break redstone on top of block with torch it work as it should, if you place it back it won't.
I can also confirm that this bug still exists in Minecraft 1.5.1.
This appears to be a visual glitch. Since the power output is 1, it should not travel 2 blocks, however the side of the block with the redstone appears powered. I believe this is due to the side redstone being in the same block as the powered redstone piece.

This is fixed in 14w32d
Still an issue in 1.8.2-pre5. See MC-76971.
Can confirm for 16w39c.
16w39c is already listed.
Can confirm for 1.12
Confirmed for 1.13.1.

The problem is that when a redstone component (piston, redstone lamp, trapdoor, repeater etc) checks to see if redstone is pointing towards it
It actually checks to see if the dust is pointing away from it AND if it is not pointing to the left or right
(There's a separate check to see if the dust is a dot, rather than a line)
It should also check if the dust is pointing towards the component
There is a few performance optimizations that can be done at the same time
Inside BlockRedstoneWire.class, getSignal()
Currently, it runs this code...
Checks if the block is shouldSignal, if false return 0 (this seems unneeded as getDirectSignal() already does the exact same check beforehand)
Checks if the power level of dust equals 0, if true return 0 (Good)
Checks if the direction is facing upwards (if there's a redstone component below the dust. Upwards is from the perspective of the component), if true return power level (Good)
Runs for loop, checking each of the four horizontal directions to see if the dust should connect to that side and saves it to a list (This is unneeded as not all directions need to be checked resulting in extra unneeded lag)
Checks list to see if the dust is connecting nowhere (dot). (This check should be done last to save on lag)
Checks list to see if dust is pointing away from the redstone component AND if it's NOT pointing to the left OR right, if true returns power level
else return 0
Here is my solution to the problem
Check if the block is shouldSignal, if false return 0 (this may or may not be needed)
Check if the direction is facing downwards (Downwards is from the perspective of the redstone component), if true return 0 (this is if the redstone component is on top of the redstone dust (won't be powered))
Check if the power level of dust equals 0, if true return 0 (unchanged)
Check if the direction is facing upwards, if true return power level (unchanged)
Check if the dust can connect in the direction of the redstone component (isPowerSourceAt(direction.getOpposite()))), if true return power level (this check is for if the dust is a line)
Check if it can connect to the left OR right, if true return 0 (this accounts if the dust is a dot or isn't pointing towards the redstone component)
else return power level
This fix will also increase performance as it doesn't need to check if the dust can connect to the opposite side and it only checks the directions it could connect to as it needs them, rather than all at once and using wastefully
Below are different scenarios for a redstone lamp being powered or not powered by dust that has been redirected
The redstone dust is sitting on the gold block
A redstone lamp will be used to show where the dust is powering
Stone buttons will be used to redirect the dust
In some pictures, there is dust on top of the redstone lamp
Vanilla is on the left, fixed on the right
[media]
Check if the direction is facing downwards, if true return 0
[media]
Check if the power level of the dust equals 0, if true return 0
[media]
Check if the direction is facing upwards, if true return power level
[media]
[media]
Check if the dust can connect in the direction of the redstone component, if true return power level. (Vanilla doesn't have this check, so it returns 0)
[media]
Check if dust is pointing away from the redstone component AND NOT pointing to the left OR right, if true returns power level (Only vanilla has this check, I split this up to fix the bug and increase performance)
[media]
Check if the dust is connecting nowhere (dot) (Vanilla has this check, but my version has this check built into the next check)
[media]
Check if it can connect to the left OR right, if false return power level
[media]
else return 0
Some more pictures with vanilla on the left and fixed on the right
[media][media][media]
[media]
Notice how vanilla doesn't power the redstone lamp even though the dust is pointing towards it
And only if there is an isPowerSourceAt() on the other side of the lamp
[media]
Code using Mojang mappings
public int getSignal(BlockState blockState, BlockGetter blockGetter, BlockPos blockPos, Direction direction) {
if(true) { //Vanilla
if (!this.shouldSignal) {
return 0;
}
int n = blockState.getValue(POWER);
if (n == 0) {
return 0;
}
if (direction == Direction.UP) {
return n;
}
EnumSet<Direction> enumSet = EnumSet.noneOf(Direction.class);
for (Direction direction2 : Direction.Plane.HORIZONTAL) {
if (this.isPowerSourceAt(blockGetter, blockPos, direction2))
enumSet.add(direction2);
}
if (direction.getAxis().isHorizontal() && enumSet.isEmpty()) {
return n;
}
if (enumSet.contains(direction) && !enumSet.contains(direction.getCounterClockWise()) && !enumSet.contains(direction.getClockWise())) {
return n;
}
return 0;
} else { //Fixes MC-8645 and increases performance
if (!this.shouldSignal) { //This is already checked in getDirectSignal()
return 0;
}
if (direction == Direction.DOWN) {
return 0;
}
int n = blockState.getValue(POWER);
if (n == 0) {
return 0;
}
if (direction == Direction.UP) {
return n;
}
if (this.isPowerSourceAt(blockGetter, blockPos, direction.getOpposite())) {
return n;
}
if (this.isPowerSourceAt(blockGetter, blockPos, direction.getCounterClockWise() || this.isPowerSourceAt(blockGetter, blockPos, direction.getClockWise())) {
return 0;
}
return n;
}
}

! Seems to be resolved in 20w18a.

A wire that is redirected to go over a block will now always provide power to the block. This is most noticeable when the wire has signal strength 1.