Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-161402

Order in which block updates are sent is directional

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: 1.14.4, 19w38b, 1.15 Pre-release 4, 1.15 Pre-release 7, 1.15.2, 20w11a, 20w12a, 20w17a, 20w18a, 1.16 Pre-release 2, 20w27a
    • Fix Version/s: None
    • Labels:
    • Confirmation Status:
      Confirmed

      Description

      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

        Attachments

        1. 1WideTileableT-Flip-Flop.mp4
          397 kB
        2. 2019-09-19_19.35.11.png
          2019-09-19_19.35.11.png
          416 kB
        3. 2019-09-19_19.36.16.png
          2019-09-19_19.36.16.png
          406 kB
        4. 2019-09-19_19.37.30.png
          2019-09-19_19.37.30.png
          430 kB
        5. 2019-09-19_19.38.05.png
          2019-09-19_19.38.05.png
          422 kB
        6. 2019-09-19_19.40.36.png
          2019-09-19_19.40.36.png
          638 kB
        7. 2019-09-19_19.43.39.png
          2019-09-19_19.43.39.png
          631 kB
        8. 2019-09-19_19.43.58.png
          2019-09-19_19.43.58.png
          425 kB
        9. 2019-09-19_19.44.14.png
          2019-09-19_19.44.14.png
          413 kB
        10. 2019-09-19_19.57.41.png
          2019-09-19_19.57.41.png
          373 kB
        11. ObserverUpdateOrder.mp4
          1.05 MB
        12. RepUpdateOrder.mp4
          534 kB
        13. ShakingPiston.mp4
          1.09 MB
        14. TorchBased1TickPulseGen.mp4
          529 kB

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              RedCMD RedCMD
              Votes:
              19 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                CHK: