WearBlackAllDay / DimensionalThreading

An attempt to optimize the fabric server, by assigning each dimension their own thread.
MIT License
255 stars 22 forks source link

Breaking sticky piston's behavior in the nether and the end #72

Open CaveNightingale opened 1 year ago

CaveNightingale commented 1 year ago

BUG.litematic.zip Import the machine into litematic and then paste it into the nether and you will see the bug. The sticky piston failed pull piston block back into the glass wall randomly when dimthread is present. However this machine works well in servers with only fabric-api installed. To my surprise, the bug does not seem to affect overworld.

Tested on 1.18.2

xiaoyu2006 commented 1 year ago

Can reproduce, however it's still not sure with mod is conflicting.

CaveNightingale commented 1 year ago

Can reproduce, however it's still not sure with mod is conflicting.

Only fabric and dimthread are installed on the server side.

zhenaiwork commented 1 year ago

在末地也会发生相似的情况

CaveNightingale commented 1 year ago

@xiaoyu2006 @WearBlackAllDay I created a much simpler machine so that I can see that bug clearly. The expected behavior is pushing the grass block out when I switch the lever on, and pulling the block back when I switch the lever off. However, when the gamerule dimthread_active is true, The sticky piston sometimes pushes the grass block out and then pulls it back immediately without my switching it off. BUG3.litematic.gz

CaveNightingale commented 1 year ago

在末地也会发生相似的情况

对的,这个BUG是由于活塞需要使用游戏时间来决定是否应该拉回方块,而时间是在主世界线程更新的,因此除了主世界线程以外的其他线程都有问题,见https://github.com/CaveNightingale/DimensionalThreading/commit/ff3c9a9d9e78c87f8b05605793d377ddff3060d0

You're right. I have fixed this bug. Sticky Pistons decide to pull blocks back or not depending on the game time. But the time is ticked on the thread of overworld. That's the reason why sticky pistons have unexpected behavior in the nether and the end. See https://github.com/CaveNightingale/DimensionalThreading/commit/ff3c9a9d9e78c87f8b05605793d377ddff3060d0