PropagationRun uses incorrect neighbour position
SquidDev opened this issue ยท 2 comments
Mod versions
- Forge: 14.23.5.2825 (1.12.2)
- CodeChickenLib: 1.12.2-3.2.2.353
- ForgeMultipart: 1.12.2-2.6.1.81
- MrTJPCore: 1.12.2-2.1.3.35
- ProjectRed Core, Compat, Integration: 1.12.2-4.9.1.92
Details
PropagationRun
calls Block.neighborChanges
with a neighbour position of the updated block, rather than the position of the wire. It's not a major issue, but may confuse mods which expect the neighbour position to be in one of the cardinal directions.
Got back to this today. After some thought, decided to implement using first-change position. The propagator keeps track of the neighbor that caused the update (850b926)
Note that since wires propagate fully and alert neighbors in bulk, there could be times were multiple wires in different positions update the same block. We bulk these updates together for performance (i.e. each unique neighbor will only receive a single notification). Therefore, we can only do the neighbor update notification with a single source position. The source position used is the very first wire in a chain that requests to have a neighbor updated.
For example, in the below picture, if the lever is flipped, the signal will propagate around clockwise from wires 1 - 5. While wires 2, 4, and 6 are all changing, the lamp block will receive only a single neighbor changed event from wire 2