mirror of
https://github.com/Minestom/Minestom.git
synced 2024-10-01 07:57:41 +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
|
* @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;
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user