NucleoidMC / fantasy

Library to support creating dimensions at runtime
GNU Lesser General Public License v3.0
88 stars 25 forks source link

Setting shouldTickTime to true makes scheduled functions to softlock the game, and run faster than the tick rate #54

Closed Awakened-Redstone closed 1 week ago

Awakened-Redstone commented 3 weeks ago

Creating a dimension with shouldTickTime causes scheduled functions to not run properly, with things like VanillaTweaks datapacks, that infinitely schedule a function to run on the next tick to freeze the server

an example function is

execute if score timer softlock matches ..100 run schedule function softlock 1t
scoreboard players add timer softlock 1

https://github.com/NucleoidMC/fantasy/assets/40528665/439114b0-322e-4711-bcc0-ac515c93f3d9

Awakened-Redstone commented 3 weeks ago

The command schedule system uses the world time to define when a command runs, if the time is higher or equals to the scheduled time it executes I imagine that it uses the time of the current world to schedule but the time of the overworld to know if it should run, making the commands run immediately due to the time mismatch

This may be a vanilla bug, but fixable via a simple mixin

I have not verified this idea yet

Awakened-Redstone commented 2 weeks ago

After looking at the source code, this makes no sense and the issue doesn't seem to be what I was thinking I can't understand how nor why this is happening...