mojira.dev
MC-161402

Order in which block updates are sent is directional

The Bug

The order in which block updates are sent from the source is directional when rotating around the Y Axis

The current system updates the blocks on the X axis, then the Y and last the Z
-+XYZ, -X +X -Y +Y -Z +Z, West East Down Up North South
This causes problems when rotating around the Y axis, as depending on the rotation, the X axis could update before or after Y
This means you can currently rotate around the Z axis without this problem
But you can't rotate most things around the X axis because repeaters don't go on walls
Changing the non-directional axis from Z to Y makes a lot more sense

 

Potential Fix

If the update order was changed to -+XZY, -X +X -Z +Z -Y +Y, West East North South Down Up

It would mean that X (and Z) will always update before Y, no matter the Y rotation

Observer notification updates already have this fix
They update -+XZY rather than block update's -+XYZ
Block updates should be changed from -+XYZ to -+XZY to be made consistent with observers
Observers were Y axis directional in 1.12.2, but they are no longer in 1.14+

The change can be done by having .below() and .above() update after .north() and .south(), inside the class level.java (located at minecraft/world/level/), method updateNeighborsAt() and updateNeighborsAtExceptFromFacing()

public void updateNeighborsAt(BlockPos blockPos, Block block) {
    this.neighborChanged(blockPos.west(), block, blockPos);
    this.neighborChanged(blockPos.east(), block, blockPos);
    this.neighborChanged(blockPos.below(), block, blockPos);
    this.neighborChanged(blockPos.above(), block, blockPos);
    this.neighborChanged(blockPos.north(), block, blockPos);
    this.neighborChanged(blockPos.south(), block, blockPos);
}

public void updateNeighborsAtExceptFromFacing(BlockPos blockPos, Block block, Direction direction) {
    if (direction != Direction.WEST) {
        this.neighborChanged(blockPos.west(), block, blockPos);
    }
    if (direction != Direction.EAST) {
        this.neighborChanged(blockPos.east(), block, blockPos);
    }
    if (direction != Direction.DOWN) {
        this.neighborChanged(blockPos.below(), block, blockPos);
    }
    if (direction != Direction.UP) {
        this.neighborChanged(blockPos.above(), block, blockPos);
    }
    if (direction != Direction.NORTH) {
        this.neighborChanged(blockPos.north(), block, blockPos);
    }
    if (direction != Direction.SOUTH) {
        this.neighborChanged(blockPos.south(), block, blockPos);
    }
}

 

Additional information

With the image of the dispensers:

On the right-hand side: The top dispenser places the water, then the left dispenser picks it up instantly
On the left side: The right dispenser drops an empty bucket, then the top dispenser places the water

Each pair of pictures shows the current directional system and the non-directional fixed version

Panda4994 has a video and mod on this issue
https://www.youtube.com/watch?v=aRr3NpmQiCg
http://www.mediafire.com/download/b9mjwuimu2ei7wg/1.9_UpdateOrder.zip

This bug has nothing to do with MC-108
MC-11193 does not cause this, but the other way round, this bug contributes to MC-11193
Nor is it a piston bug, it's just that its most easily seen with pistons

Related issues

Attachments

Comments

migrated
[media][media][media][media][media][media][media][media][media][media][media][media][media][media]
RedCMD
RedCMD

Observers notifications already have the order -+ xzy
Tho block updates are still stuck on -+ xyz
This should be changed to make it more consistent with observers

PR0CESS

Still present in 21w19a
No idea why you classified this as Low priority. It takes 2min for you to change...

RedCMD

(Unassigned)

Confirmed

Platform

Low

Redstone

block, redstone

1.14.4, 19w38b, 1.15 Pre-release 4, 1.15 Pre-release 7, 1.15.2, ..., 20w27a, 1.16.4, 20w46a, 1.16.5, 21w19a

Retrieved