Fix time update option

This commit is contained in:
Felix Cravic 2020-07-22 20:57:05 +02:00
parent 126c174bb9
commit 9b25f0a25f
2 changed files with 2 additions and 1 deletions

View File

@ -760,6 +760,7 @@ public abstract class Instance implements BlockModifier, EventHandler, DataConta
timeUpdatePacket.worldAge = worldAge;
timeUpdatePacket.timeOfDay = this.time;
PacketWriterUtils.writeAndSend(getPlayers(), timeUpdatePacket);
this.lastTimeUpdate = time;
}
}

View File

@ -3,7 +3,7 @@ package net.minestom.server.utils.time;
public class CooldownUtils {
public static boolean hasCooldown(long currentTime, long lastUpdate, TimeUnit timeUnit, int cooldown) {
long cooldownMs = timeUnit.toMilliseconds(cooldown);
final long cooldownMs = timeUnit.toMilliseconds(cooldown);
return currentTime - lastUpdate < cooldownMs;
}