TimeSkipHandler doesn't support multiple worlds
LXGaming opened this issue ยท 1 comments
Bug Report
I found this issue while investigating a "Compatibility issue" that was reported LXGaming/MixinBootstrap#6
What's the issue you encountered?
Things to be aware of:
- The
/time set <amount>
command will set the DayTime for every world. - The End and Nether share the same DayTime as the Overworld, See
DerivedWorldInfo
andServerMultiWorld
(Mod developers supposedly have the ability to override this behavior when implementing custom worlds, Keep this in mind for mod support). - Due to the
DerivedWorldInfo
the time only increments when the overworld is ticked.
Because worlds can share the same time when the TimeSkipHandler
ticks a world it will store this value in the lastDayTime
field causing subsequent worlds with the same time to not be updated due to the difference
being calculated to 0.
There is also these additional issues:
difference
may be calculated using thelastDayTime
of a different world which may have a different time.- Worlds having a difference greater than -24000 will result in it never getting updated (unless it's the first dimension to get ticked in which case it'll be updated once).
How can the issue be reproduced?
- Have one player in the Overworld and another player in the Nether. (Or get a mod like Immersive Portals to keep the Nether loaded)
- Run
/time set night
- Sleep
What happens is the Nether gets updated but not the overworld, what should happen is all worlds should get updated.
Logs
Note: I added the dimension id to the preexisting log message in the TimeSkipHandler
.
[21:29:00] [Server thread/INFO] [minecraft/DedicatedServer]: [LX_Gaming: Set the time to 13000]
[21:29:09] [Server thread/INFO] [sereneseasons/]: Season time skipped by 10815 for -1
Mod Version
SereneSeasons v1.15.2-3.0.0.67