diff --git a/shared/src/main/java/net/blay09/mods/waystones/core/PersistentPlayerWaystoneData.java b/shared/src/main/java/net/blay09/mods/waystones/core/PersistentPlayerWaystoneData.java index 53c1be3a..484684f3 100644 --- a/shared/src/main/java/net/blay09/mods/waystones/core/PersistentPlayerWaystoneData.java +++ b/shared/src/main/java/net/blay09/mods/waystones/core/PersistentPlayerWaystoneData.java @@ -12,8 +12,8 @@ public class PersistentPlayerWaystoneData implements IPlayerWaystoneData { private static final String TAG_NAME = "WaystonesData"; private static final String ACTIVATED_WAYSTONES = "Waystones"; - private static final String INVENTORY_BUTTON_COOLDOWN_UNTIL = "InventoryButtonCooldownUntilNew"; - private static final String WARP_STONE_COOLDOWN_UNTIL = "WarpStoneCooldownUntilNew"; + private static final String INVENTORY_BUTTON_COOLDOWN_UNTIL = "InventoryButtonCooldownUntilUnix"; + private static final String WARP_STONE_COOLDOWN_UNTIL = "WarpStoneCooldownUntilUnix"; @Override public void activateWaystone(Player player, IWaystone waystone) { diff --git a/shared/src/main/java/net/blay09/mods/waystones/core/PlayerWaystoneManager.java b/shared/src/main/java/net/blay09/mods/waystones/core/PlayerWaystoneManager.java index a1b581eb..4cc83a25 100644 --- a/shared/src/main/java/net/blay09/mods/waystones/core/PlayerWaystoneManager.java +++ b/shared/src/main/java/net/blay09/mods/waystones/core/PlayerWaystoneManager.java @@ -297,8 +297,8 @@ private static void applyCooldown(WarpMode warpMode, Player player, int cooldown final Level level = player.level(); switch (warpMode) { case INVENTORY_BUTTON -> - getPlayerWaystoneData(level).setInventoryButtonCooldownUntil(player, level.getGameTime() + cooldown * 20L); - case WARP_STONE -> getPlayerWaystoneData(level).setWarpStoneCooldownUntil(player, level.getGameTime() + cooldown * 20L); + getPlayerWaystoneData(level).setInventoryButtonCooldownUntil(player, System.currentTimeMillis() + cooldown * 20L); + case WARP_STONE -> getPlayerWaystoneData(level).setWarpStoneCooldownUntil(player, System.currentTimeMillis() + cooldown * 20L); } WaystoneSyncManager.sendWaystoneCooldowns(player); } @@ -513,7 +513,7 @@ public static long getWarpStoneCooldownUntil(Player player) { public static long getWarpStoneCooldownLeft(Player player) { long cooldownUntil = getWarpStoneCooldownUntil(player); - return Math.max(0, cooldownUntil - player.level().getGameTime()); + return Math.max(0, cooldownUntil - System.currentTimeMillis()); } public static void setWarpStoneCooldownUntil(Player player, long timeStamp) { @@ -526,7 +526,7 @@ public static long getInventoryButtonCooldownUntil(Player player) { public static long getInventoryButtonCooldownLeft(Player player) { long cooldownUntil = getInventoryButtonCooldownUntil(player); - return Math.max(0, cooldownUntil - player.level().getGameTime()); + return Math.max(0, cooldownUntil - System.currentTimeMillis()); } public static void setInventoryButtonCooldownUntil(Player player, long timeStamp) {