mojira.dev
MC-233420

Moving blocks update order is HashMap based, causing unreliable behavior

The Bug

observers reading blocks getting pulled are locational, meaning the update order from observers is not reliable in specific cases. Moving over the setup in the attached image with /say 1, say 2, and say 3 in the command blocks.

Steps to Reproduce

  • Build the setup shown in the image.

  • Set the command blocks to /say 1, /say 2, and /say 3.

  • Activate the piston and note the order that the numbers are said.

  • Test in multiple locations and note the differences.

Observed Behavior

The order of numbers differs based on location, this is due to the piston code that reads from a hash map when removing leftover blocks after creating moving blocks.

Expected Behavior

The order would always be the same, thus being predicable and reliable.

Related issues

Attachments

Comments

migrated
[media]
migrated

This is sad😞

Former user

why do you think observers' order is HashMap based?

In fact it isn't. Its order is always reliable.

The order of updates from blocks pulled or pushed by a piston is HashMap based, not the observors.

migrated

observer update order is directional, not locational. It goes X -> Z -> Y negative to positive. 

Former user

@CHANAK GAUTAM yes. however it is not relevant to  this report

migrated

This bug is due to the piston code that read from a hash map when removing leftover blocks after creating moving blocks

migrated

I am able to confirm this in 1.17.1

The Bug:

Observers reading blocks getting pulled are locational, meaning the update order from observers is not reliable in specific cases.

Steps to Reproduce:

  • Build the setup shown in the image.

  • Set the command blocks to /say 1, /say 2, and /say 3.

  • Activate the piston and note the order that the numbers are said.

  • Test in multiple locations and note the differences.

Observed Behavior:

The order of numbers differs based on location, this is due to the piston code that reads from a hash map when removing leftover blocks after creating moving blocks.

Expected Behavior:

The order would always be the same, thus being predicable and reliable.

theGlotzerify

can confirm in 1.18.1

migrated

(Unassigned)

Community Consensus

Platform

Normal

Redstone

1.17.1, 1.18.1

Retrieved