mirror of
https://github.com/nkomarn/harbor.git
synced 2025-01-20 14:31:30 +01:00
Merge branch 'master' of https://github.com/nkomarn/Harbor
This commit is contained in:
commit
e13660659a
@ -14,6 +14,14 @@ public class AccelerateNightTask extends BukkitRunnable {
|
|||||||
public AccelerateNightTask(final World world) {
|
public AccelerateNightTask(final World world) {
|
||||||
this.world = world;
|
this.world = world;
|
||||||
Messages.sendRandomChatMessage(world, "messages.chat.night-skipping");
|
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
|
@Override
|
||||||
@ -29,19 +37,12 @@ public class AccelerateNightTask extends BukkitRunnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (time >= (dayTime - timeRate * 1.5) && time <= dayTime) {
|
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")) {
|
if (Config.getBoolean("night-skip.reset-phantom-statistic")) {
|
||||||
world.getPlayers().forEach(player -> player.setStatistic(Statistic.TIME_SINCE_REST, 0));
|
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");
|
Messages.sendRandomChatMessage(world, "messages.chat.night-skipped");
|
||||||
this.cancel();
|
this.cancel();
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user