mirror of
https://github.com/Minestom/Minestom.git
synced 2024-09-28 14:37:31 +02:00
Fix time update option
This commit is contained in:
parent
126c174bb9
commit
9b25f0a25f
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user