1
0
mirror of https://github.com/nkomarn/harbor.git synced 2024-09-29 06:57:35 +02:00

Thunderstorm looping fix

This commit is contained in:
Mykyta 2020-04-19 10:36:16 -07:00
parent e13660659a
commit 792328de46
No known key found for this signature in database
GPG Key ID: C147E30C19EA3570

View File

@ -15,13 +15,15 @@ public class AccelerateNightTask extends BukkitRunnable {
this.world = world;
Messages.sendRandomChatMessage(world, "messages.chat.night-skipping");
if (Config.getBoolean("night-skip.clear-rain")) {
world.setStorm(false);
}
Bukkit.getScheduler().runTask(Harbor.getHarbor(), () -> {
if (Config.getBoolean("night-skip.clear-rain")) {
world.setStorm(false);
}
if (Config.getBoolean("night-skip.clear-thunder")) {
world.setThundering(false);
}
if (Config.getBoolean("night-skip.clear-thunder")) {
world.setThundering(false);
}
});
}
@Override
@ -41,8 +43,7 @@ public class AccelerateNightTask extends BukkitRunnable {
world.getPlayers().forEach(player -> player.setStatistic(Statistic.TIME_SINCE_REST, 0));
}
Bukkit.getScheduler().runTaskLaterAsynchronously(Harbor.getHarbor(),
() -> Checker.skippingWorlds.remove(world), 20);
Checker.skippingWorlds.remove(world);
Messages.sendRandomChatMessage(world, "messages.chat.night-skipped");
this.cancel();
} else {