1
0
mirror of https://github.com/nkomarn/harbor.git synced 2025-01-20 14:31:30 +01:00
This commit is contained in:
Mykyta 2020-04-19 10:35:38 -07:00
commit e13660659a
No known key found for this signature in database
GPG Key ID: C147E30C19EA3570

View File

@ -14,6 +14,14 @@ public class AccelerateNightTask extends BukkitRunnable {
public AccelerateNightTask(final World world) {
this.world = world;
Messages.sendRandomChatMessage(world, "messages.chat.night-skipping");
if (Config.getBoolean("night-skip.clear-rain")) {
world.setStorm(false);
}
if (Config.getBoolean("night-skip.clear-thunder")) {
world.setThundering(false);
}
}
@Override
@ -29,19 +37,12 @@ public class AccelerateNightTask extends BukkitRunnable {
}
if (time >= (dayTime - timeRate * 1.5) && time <= dayTime) {
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.reset-phantom-statistic")) {
world.getPlayers().forEach(player -> player.setStatistic(Statistic.TIME_SINCE_REST, 0));
}
Bukkit.getScheduler().runTaskLaterAsynchronously(Harbor.getHarbor(), () -> Checker.skippingWorlds.remove(world), 20);
Bukkit.getScheduler().runTaskLaterAsynchronously(Harbor.getHarbor(),
() -> Checker.skippingWorlds.remove(world), 20);
Messages.sendRandomChatMessage(world, "messages.chat.night-skipped");
this.cancel();
} else {