GTNewHorizons / GT-New-Horizons-Modpack

New Modpack with Gregtech, Thaumcraft and Witchery
https://www.gtnewhorizons.com/
Other
946 stars 296 forks source link

GT5 Sleeping buff is not applied when Morpheus partial sleeping skips the night #16893

Closed leumasme closed 1 week ago

leumasme commented 1 month ago

Your GTNH Discord Username

leumasme

Your Pack Version

2.6.1

Your Server

private server

Java Version

Java 21

Type of Server

Vanilla Forge

Your Expectation

When sleeping to skip the night, the GT5-Unofficial sleeping buff should kick in. If the night was skipped but not all players slept, the buffs should apply to the players that did sleep.

The Reality

When not all players sleep and Morpheus kicks in to allow partial sleeping skipping the night (Username is now sleeping. 1/2 (50%)), the sleeping buffs are not applied to anyone.

Your Proposal

Fix Compatability between GT5 and Morpheus to apply sleeping buffs to the players that slept when Morpheus partial sleeping skips the night.

For reference:

Final Checklist

leumasme commented 3 weeks ago

More exactly, this seems to be caused by Morpheus checking the player sleep state and starting a new Day at the end of a tick, but not actually waking up the players. When the next tick starts, the world time is first increased and then players are automatically woken up because it's already day - but at this point, its not the first tick of the day anymore.

This could be fixed by calling WorldServer.wakeAllPlayers at the end of SleepChecker.advanceToMorning. This would also replace the world.provider.resetRainAndThunder(); call since WorldServer.wakeAllPlayers already does that.

It seems like there is no GTNH fork of Morpheus and the original project has no license.