[fix] Fix Redstone Link desyncs#10077
[fix] Fix Redstone Link desyncs#10077Pordrack wants to merge 1 commit intoCreators-of-Create:mc1.21.1/devfrom
Conversation
|
This doesn't fix #3467. Haven't tested the others yet or done much determining to which degree those are duplicates of each other (but they don't seem to be duplicates of 3467 at least) How does your testing of the fix (think I figured it out but they were written a bit unclear imo) relate to the issues you bring up? There seems to be a bit of a disconnect there to how that exactly relates to the link behaviour when chunks are unloaded. Have you tested this at all with reloading the world/had a reproducing setup where reloading the world broke it without your patch but didn't with? |
|
You are right, after more concrete testing it appears my "fix" do nothing. I will investigate further. |
Hello,
This pull request is an attempt to fix the problems with Redstone Links de-linking from one another during chunk reloads on certain conditions. These issues have been reported in #3467 #5009 #8934 #8806 #6690 #4276
Since this is a little hard to reproduce, I tested my fix in those conditions: I placed 1 emitter and receptor and while it was off, I made a "F3+I" copy of the receptor, capturing it in this state. I then turned on the contraption, and using a command block I replaced the receptor (at that point turned on) by its off copy. The pair would now be out of sync, with the receptor staying off. Note that the same thing would happen with a copy of the receptor turned on pasted onto an off receptor. After my fix, attempting to replace the receptor by its "opposite copy" result in it almost immediately switching back to the right state.
While investigating, I found that what prevented the receptor from updating itself in the bug condition was the "if (!newPosition)" check of "setReceivedStrength". I'm new to coding for the Create mod, so I could be disrupting something important, but I noticed that the check dated back from 2020 and that under normal circumstances (a pair of working links), the code never returns because of this check and the rest of the function is executed every frame.