change UpdateOption value from int to long

This commit is contained in:
themode 2021-02-07 20:14:40 +01:00
parent f7aeeabe9c
commit 2d7e16fa8e
2 changed files with 7 additions and 4 deletions

View File

@ -17,7 +17,7 @@ public final class CooldownUtils {
* @param cooldown the value of the cooldown * @param cooldown the value of the cooldown
* @return true if the cooldown is in progress, false otherwise * @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); final long cooldownMs = timeUnit.toMilliseconds(cooldown);
return currentTime - lastUpdate < cooldownMs; return currentTime - lastUpdate < cooldownMs;
} }

View File

@ -1,19 +1,22 @@
package net.minestom.server.utils.time; package net.minestom.server.utils.time;
import org.jetbrains.annotations.NotNull;
public class UpdateOption { public class UpdateOption {
private final int value; private final long value;
private final TimeUnit timeUnit; private final TimeUnit timeUnit;
public UpdateOption(int value, TimeUnit timeUnit) { public UpdateOption(long value, @NotNull TimeUnit timeUnit) {
this.value = value; this.value = value;
this.timeUnit = timeUnit; this.timeUnit = timeUnit;
} }
public int getValue() { public long getValue() {
return value; return value;
} }
@NotNull
public TimeUnit getTimeUnit() { public TimeUnit getTimeUnit() {
return timeUnit; return timeUnit;
} }