Client-side parts no-longer receive packets when placed
Kneelawk opened this issue ยท 0 comments
The Issue
Since some of the blanket-con fixes were introduced to LMP, I ran into an issue where client-side parts stopped receiving packets after being placed. A world reload fixes the parts already placed, but the issue re-appears in any newly placed parts.
From what I can tell, the issue was introduced in 85ef0b8. This commit introduces a change to ignore all packets received on the client-side for PartContainers who's hasInitialisedFromRemote value is false. However the hasInitialisedFromRemote value is only set to true in PartContainer.readInitialRenderData after first checking that the PartContainer contains no parts. However, when a part is first placed instead of being loaded form NBT, the PartContainer.readAddPart handler is invoked before PartContainer.readInitialRenderData, meaning that the PartContainer already contains parts by the time PartContainer.readInitialRenderData is invoked, meaing that hasInitialisedFromRemote is never set to true, causing all client-side packets to be ignored.
Potential Fix
The simplest fix would be just to remove the hasInitialisedFromRemote check from the NET_KEY_PART decoder.
Associated
This issue describes what I am trying to fix in #53.