Related Issues Reported: MCPE-167043. The issue was only fixed in 1.20.30 and then reappeared in subsequent releases.
The video has been uploaded.
And, thank you for your attention and reminder. I found that my idea that when multiple pistons can affect the same block, it can cause more lag.
So I optimized it, combining the game's original algorithm with my ideas.
If multiple pistons can affect the same block, precomputing and caching the block tree may result in higher stuttering.
We no longer precompute and cache block trees. Instead, it is calculated when the piston/viscous piston needs to push or pull the block. If the push or pull is unsuccessful, the block tree is cached. At the same time, when adding a block, only check if the block joins or blocks (or even exists at the same time) the existing surrounding block tree, and recalculates the surrounding block tree when replacing or removing the block.
The supplement proposed here should be able to solve the problem of multiple pistons affecting the same block or several blocks more effectively, and optimize the block tree update logic.
If possible, I will try to show the optimization algorithm in the form of a flowchart (limited by my academic level (1st year of high school), I may not be able to complete this flowchart)
You may be able to add this optimization algorithm to the game as an experimental gameplay to allow other players in the community to test its stability and lag together
The color fix package for screenshots has been uploaded, and the content is the same as the original except for the use of “Math.max()” to truncate negative values at the color parameters.