mrgeneralq / sleep-most

Control the amount of percentage of sleeping players required to make it day. 100K+ downloads on spigot!
https://www.spigotmc.org/resources/sleep-most-1-14-4-configurable-messages-and-percentage.60623/
30 stars 12 forks source link

"storm-sleep: false" blocking sleep though weather is clear #147

Closed kriskane closed 1 year ago

kriskane commented 2 years ago

Occasionally players will find it impossible to sleep during clear weather with the plugin displaying the no-sleep-storm message as if the weather were set to thunderstorm. However, through testing we have determined that the sleep is blocked during apparently clear weather if a storm happens on the next game day.

This is reproducible by trying to sleep each in-game night until the plugin blocks it. On seed 4503599804565464, this occurs on night 116 (I believe weather patterns are seed-dependent). If you try to sleep after 18:33 game time on day 116, you should see this behavior, and after 00:00 game time on day 117, a thunderstorm will start.

The expected behavior is to be able to sleep during (apparently?) clear weather.

This occurs with version 5.1.1 of sleepmost and git-paper-137 (mc 1.19.2).

kriskane commented 2 years ago

We have now also seen the bug with no thunderstorm on the subsequent day, so it's likely not linked to the next day's weather.

mrgeneralq commented 1 year ago

Hello Kriskane

Thank you for reaching out to us. As for now, our plugin is making use of the mechanics provided by the Spigot API to determine whether there is a storm going on or not. This could be the result of either 2 things:

  1. The biome/region you are in, is not having any rain. This could be the result of a plugin such as worldguard or other world controlling plugins. Verify this by flying to another location. (also weather effects are not disabled on the client?)

  2. In case the above is not true, then this might be related to a bug of Spigot API itself. However I have to say that this is the very first report of this kind.

Below you can find a reference to what function we use to determine whether it's raining or not. https://github.com/mrgeneralq/sleep-most/blob/e07f9e1f0f89049aa3e6d73ed8f6ac1c31191faa/src/main/java/me/mrgeneralq/sleepmost/services/SleepService.java#L234

In case you still believe we are wrong, you are free to re-open this issue. As for now I believe it can be considered invalid. Kind regards

Quinten

mrgeneralq commented 1 year ago

There are multiple reports of this issue it seems. We are doing some further investigation

mrgeneralq commented 1 year ago

After further investigation, it could be that sleep-most is indeed preventing to sleep during clear weather. However we can also confirm that if this is the case, sleep-most is not causing this issue. Sleep-Most is reading from the out of the box API if the world has an active thunderstorm.

If for some reason this is not working, it means that something (some other plugin maybe such as essentials) didn't correctly change the weather state.

Please also note that there is a difference between sun , storm, and thunderstorm. It can be clear weather, with the world being in thunderstorm (true).

Sleep-Most is exactly reading that. Please try again with no plugins installed except sleep-most.

Kind regards

Quinten