Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sleeping with this plugin prevents rain ? #71

Open
vgalin opened this issue Nov 15, 2020 · 1 comment
Open

Sleeping with this plugin prevents rain ? #71

vgalin opened this issue Nov 15, 2020 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@vgalin
Copy link

vgalin commented Nov 15, 2020

Hi, I'm part of a small/medium-sized server that uses this plugin. Most of the time, a few people sleep and the night is skipped.
Recently some of us were waiting for a thunderstorm (so that we could make charged creepers an gather mob heads) but we realized that we hadn't seen rain since Harbor was installed.

In Vanilla, when you sleep and the night is skipped, the weather is cleared and the next weather-event (rain/thunder) is postponed (most of the time).

By looking at the comments in the Harbor config file, it seemed to us that this behavior was different (because you precised (if it's raining) and (if it's thundering)).

clear-rain: true # Clear rain (if it's raining) when the night is skipped
clear-thunder: true # Clear thunder (if it's thundering) when the night is skipped        

Taking a look at the Harbor source file, it seemed that rain and thunder are cleared no matter what if clear-rain and clear-thunder are respectively set to true in the config file.

if (config.getBoolean("night-skip.clear-rain")) {
    world.setStorm(false);
}

if (config.getBoolean("night-skip.clear-thunder")) {
    world.setThundering(false);
}

At this point I thought that world.setStorm(false); and world.setThundering(false); could potentially reset the time until the next weather-event and that because it was called every night on our server the "bad" weather would always be postponed.

To test this hypothesis, I forked Harbor, and made these tiny changes :

if (config.getBoolean("night-skip.clear-rain") && world.hasStorm()) {
    world.setStorm(false);
}

if (config.getBoolean("night-skip.clear-thunder") && world.isThundering()) {
    world.setThundering(false);
}

The idea behind these changes was :

  • To still allow players to skip bad weather by sleeping
  • To reset the time until the next weather-event only if it is currently raining

I pushed the changes to my repo and retrieved the artifact built by the CI, and we tried this version on the server. We purposedly slept every night to see if the modified version of the plugin made any difference, but it didn't, we still had no rain.

The only working solution we have at the moment is only but a workaround : it rains when nobody sleeps for a few nights.

At this point I have no idea what is postponing rain/thunder (note that the only plugins installed are dynmap, Harbor and WorldBorder). Am I missing something ?

@vgalin vgalin changed the title Sleeping with this plugin prevent rain ? Sleeping with this plugin prevents rain ? Nov 15, 2020
@nkomarn
Copy link
Owner

nkomarn commented Nov 15, 2020

Hm, interesting. Maybe try enabling instant-skip in the configuration and see if the behavior changes? Otherwise, there's nothing else I can think of at the moment.

@nkomarn nkomarn added help wanted Extra attention is needed bug Something isn't working labels Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants