Skip to content

Commit

Permalink
fix: re last commit: also change from ticks to ms since game time was…
Browse files Browse the repository at this point in the history
… in ticks
  • Loading branch information
BlayTheNinth committed Dec 7, 2023
1 parent 4f217e3 commit ac681fc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public static void initialize() {
long timeLeft = PlayerWaystoneManager.getInventoryButtonCooldownLeft(player);
IWaystone waystone = PlayerWaystoneManager.getInventoryButtonWaystone(player);
int xpLevelCost = waystone != null ? PlayerWaystoneManager.predictExperienceLevelCost(player, waystone, WarpMode.INVENTORY_BUTTON, (IWaystone) null) : 0;
int secondsLeft = (int) (timeLeft / 20);
int secondsLeft = (int) (timeLeft / 1000);
if (inventoryButtonMode.hasNamedTarget()) {
tooltip.add(formatTranslation(ChatFormatting.YELLOW, "gui.waystones.inventory.return_to_waystone"));
tooltip.add(formatTranslation(ChatFormatting.GRAY, "tooltip.waystones.bound_to", ChatFormatting.DARK_AQUA + inventoryButtonMode.getNamedTarget()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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, System.currentTimeMillis() + cooldown * 20L);
case WARP_STONE -> getPlayerWaystoneData(level).setWarpStoneCooldownUntil(player, System.currentTimeMillis() + cooldown * 20L);
getPlayerWaystoneData(level).setInventoryButtonCooldownUntil(player, System.currentTimeMillis() + cooldown * 1000L);
case WARP_STONE -> getPlayerWaystoneData(level).setWarpStoneCooldownUntil(player, System.currentTimeMillis() + cooldown * 1000L);
}
WaystoneSyncManager.sendWaystoneCooldowns(player);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public int getBarWidth(ItemStack itemStack) {
}

long timeLeft = PlayerWaystoneManager.getWarpStoneCooldownLeft(player);
int maxCooldown = WaystonesConfig.getActive().cooldowns.warpStoneCooldown * 20;
int maxCooldown = WaystonesConfig.getActive().cooldowns.warpStoneCooldown * 1000;
if (maxCooldown == 0) {
return MAX_BAR_WIDTH;
}
Expand All @@ -215,7 +215,7 @@ public void appendHoverText(ItemStack stack, @Nullable Level world, List<Compone
}

long timeLeft = PlayerWaystoneManager.getWarpStoneCooldownLeft(player);
int secondsLeft = (int) (timeLeft / 20);
int secondsLeft = (int) (timeLeft / 1000);
if (secondsLeft > 0) {
var secondsLeftText = Component.translatable("tooltip.waystones.cooldown_left", secondsLeft);
secondsLeftText.withStyle(ChatFormatting.GOLD);
Expand Down

0 comments on commit ac681fc

Please sign in to comment.