From 2d7e16fa8e25a8d8e106af31e6d5636c0caa92bb Mon Sep 17 00:00:00 2001 From: themode Date: Sun, 7 Feb 2021 20:14:40 +0100 Subject: [PATCH] change UpdateOption value from int to long --- .../net/minestom/server/utils/time/CooldownUtils.java | 2 +- .../net/minestom/server/utils/time/UpdateOption.java | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/minestom/server/utils/time/CooldownUtils.java b/src/main/java/net/minestom/server/utils/time/CooldownUtils.java index 601c4458e..8d9fc90fa 100644 --- a/src/main/java/net/minestom/server/utils/time/CooldownUtils.java +++ b/src/main/java/net/minestom/server/utils/time/CooldownUtils.java @@ -17,7 +17,7 @@ public final class CooldownUtils { * @param cooldown the value of the cooldown * @return true if the cooldown is in progress, false otherwise */ - public static boolean hasCooldown(long currentTime, long lastUpdate, @NotNull TimeUnit timeUnit, int cooldown) { + public static boolean hasCooldown(long currentTime, long lastUpdate, @NotNull TimeUnit timeUnit, long cooldown) { final long cooldownMs = timeUnit.toMilliseconds(cooldown); return currentTime - lastUpdate < cooldownMs; } diff --git a/src/main/java/net/minestom/server/utils/time/UpdateOption.java b/src/main/java/net/minestom/server/utils/time/UpdateOption.java index c86315bab..37ccd6361 100644 --- a/src/main/java/net/minestom/server/utils/time/UpdateOption.java +++ b/src/main/java/net/minestom/server/utils/time/UpdateOption.java @@ -1,19 +1,22 @@ package net.minestom.server.utils.time; +import org.jetbrains.annotations.NotNull; + public class UpdateOption { - private final int value; + private final long value; private final TimeUnit timeUnit; - public UpdateOption(int value, TimeUnit timeUnit) { + public UpdateOption(long value, @NotNull TimeUnit timeUnit) { this.value = value; this.timeUnit = timeUnit; } - public int getValue() { + public long getValue() { return value; } + @NotNull public TimeUnit getTimeUnit() { return timeUnit; }