[MC-8645] Redstone wire receiving level 1 power from a block, pointing at another block with wire on it will not power that block Created: 29/Jan/13  Updated: 29/Apr/20  Resolved: 29/Apr/20

Status: Resolved
Project: Minecraft: Java Edition
Component/s: None
Affects Version/s: Snapshot 13w03a, Snapshot 13w04a, Snapshot 13w09c, Snapshot 13w10a, Minecraft 1.5, Snapshot 13w11a, Minecraft 1.5.1, Minecraft 1.6.4, Minecraft 13w42b, Minecraft 13w43a, Minecraft 1.7.1, Minecraft 1.7.2, Minecraft 1.7.4, Minecraft 14w08a, Minecraft 1.8.2-pre4, Minecraft 1.8.2-pre5, Minecraft 15w40b, Minecraft 1.10.2, Minecraft 16w38a, Minecraft 16w39c, Minecraft 16w42a, Minecraft 16w43a, Minecraft 16w44a, Minecraft 1.11 Pre-Release 1, Minecraft 1.12, Minecraft 1.12.2, Minecraft 18w07c, Minecraft 1.13.1, 1.15.2, 20w11a, 20w12a, 20w17a
Fix Version/s: Minecraft 1.8, 20w18a

Type: Bug
Reporter: RedCMD Assignee: Unassigned
Resolution: Fixed Votes: 16
Labels: redstone, redstone-comparator, redstone-dust, signal-decay, signal-strength
Environment:

Windows 7 64bit
Java 1.7.0 (as Minecraft shows)


Attachments: PNG File 2019-07-25_19.10.44.png     PNG File 2019-07-25_19.11.17.png     PNG File 2019-07-25_19.13.15.png     PNG File 2019-07-25_19.13.42.png     PNG File 2019-07-25_19.17.04.png     PNG File 2019-07-25_19.17.24.png     PNG File MC8645 0.png     PNG File MC8645 Away&Towards.png     PNG File MC8645 Away.png     PNG File MC8645 Dot.png     PNG File MC8645 Down.png     PNG File MC8645 Side&Away.png     PNG File MC8645 Side&Towards Fixed.png     PNG File MC8645 Side&Towards Vanilla.png     PNG File MC8645 Side.png     PNG File MC8645 Towards Fixed.png     PNG File MC8645 Towards Vanilla.png     PNG File MC8645 Towards&Away Fixed.png     PNG File MC8645 Towards&Away Vanilla.png     PNG File MC8645 Up.png     JPEG File goodandbad.jpg     JPEG File screenshot-1.jpg    
Issue Links:
Duplicate
is duplicated by MC-8654 Repeater fails to pull weakest signal... Resolved
is duplicated by MC-38757 Redstone bug connected with comparators. Resolved
is duplicated by MC-69764 Minecraft powering bug Resolved
is duplicated by MC-76971 Redstone under very specific circumst... Resolved
is duplicated by MC-108083 Redstone Ontop of Observer Output Can... Resolved
is duplicated by MC-131306 Redstone with strength 1 behaves inco... Resolved
Relates
relates to MC-2255 Redstone wire uses different criteria... Resolved
relates to MC-3703 Redstone changing orientation doesn't... Reopened
relates to MC-9405 Top piece of staircase redstone dust ... Resolved
relates to MC-181489 Redstone dust "quasi-powers" full blocks Resolved
CHK:
Confirmation Status: Confirmed
Category:
Redstone

 Description   

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

Comment



 Comments   
Comment by [Mod] Pokechu22 [ 29/Apr/20 ]

20w18a changelog:

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.

Comment by Tooster [ 29/Apr/20 ]

! Seems to be resolved in 20w18a.

Comment by RedCMD [ 25/Jul/19 ]

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...

  1. Checks if the block is shouldSignal, if false return 0 (this seems unneeded as getDirectSignal() already does the exact same check beforehand)
  2. Checks if the power level of dust equals 0, if true return 0 (Good)
  3. 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)
  4. 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)
  5. Checks list to see if the dust is connecting nowhere (dot). (This check should be done last to save on lag)
  6. 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
  7. else return 0

 

Here is my solution to the problem

  1. Check if the block is shouldSignal, if false return 0 (this may or may not be needed)
  2. 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))
  3. Check if the power level of dust equals 0, if true return 0 (unchanged)
  4. Check if the direction is facing upwards, if true return power level (unchanged)
  5. 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)
  6. 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)
  7. 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

 


Check if the direction is facing downwards, if true return 0

 


Check if the power level of the dust equals 0, if true return 0

 

 
Check if the direction is facing upwards, if true return power level

 


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)

 


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)

 


Check if the dust is connecting nowhere (dot) (Vanilla has this check, but my version has this check built into the next check)

 


Check if it can connect to the left OR right, if false return power level

 

else return 0

 

Some more pictures with vanilla on the left and fixed on the right


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

 

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;
    }
}
Comment by Oval [ 17/Sep/18 ]

Confirmed for 1.13.1.

Comment by [Mod] NeunEinser [ 23/Jul/17 ]

Can confirm for 1.12

Comment by [Mod] Neko [ 04/Oct/16 ]

16w39c is already listed.

Comment by K [ 04/Oct/16 ]

Can confirm for 16w39c.

Comment by Anon Ymus [ 28/Jan/15 ]

Still an issue in 1.8.2-pre5. See MC-76971.

Comment by qmagnet [ 12/Aug/14 ]

This is fixed in 14w32d

Comment by Talven81 [ 25/Feb/14 ]

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.

Comment by Kwin van der Veen [ 20/Apr/13 ]

I can also confirm that this bug still exists in Minecraft 1.5.1.

Comment by MiiNiPaa [ 29/Jan/13 ]

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.

Generated at Sun Jan 12 12:18:28 UTC 2025 using Jira 9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13.