mirror of
https://github.com/Minestom/Minestom.git
synced 2024-09-29 15:07:36 +02:00
change UpdateOption value from int to long
This commit is contained in:
parent
f7aeeabe9c
commit
2d7e16fa8e
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user