mirror of
https://github.com/nkomarn/harbor.git
synced 2025-01-05 07:07:34 +01:00
⚡ Thunderstorm looping fix
This commit is contained in:
parent
e13660659a
commit
792328de46
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user