From f0dc7ce32b13edd30f1d112a2fd9a3ca55236dd2 Mon Sep 17 00:00:00 2001 From: Christopher Martin Date: Tue, 21 Jul 2020 23:25:19 -0700 Subject: [PATCH] Add getMovePreviewWithoutCooldownTimer (#1074) ## Additions * Adds `GeneralMethods::getMovePreviewWithoutCooldownTimer(Player)` --- .../projectkorra/ability/CoreAbility.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/com/projectkorra/projectkorra/ability/CoreAbility.java b/src/com/projectkorra/projectkorra/ability/CoreAbility.java index b37d1b36..14b1c0eb 100644 --- a/src/com/projectkorra/projectkorra/ability/CoreAbility.java +++ b/src/com/projectkorra/projectkorra/ability/CoreAbility.java @@ -828,10 +828,20 @@ public abstract class CoreAbility implements Ability { public String getMovePreview(final Player player) { final BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player); - String displayedMessage = ""; + String displayedMessage = getMovePreviewWithoutCooldownTimer(player); if (bPlayer.isOnCooldown(this)) { final long cooldown = bPlayer.getCooldown(this.getName()) - System.currentTimeMillis(); - displayedMessage = this.getElement().getColor() + "" + ChatColor.STRIKETHROUGH + this.getName() + "" + this.getElement().getColor() + " - " + TimeUtil.formatTime(cooldown); + displayedMessage += this.getElement().getColor() + " - " + TimeUtil.formatTime(cooldown); + } + + return displayedMessage; + } + + public String getMovePreviewWithoutCooldownTimer(final Player player) { + final BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player); + String displayedMessage = ""; + if (bPlayer.isOnCooldown(this)) { + displayedMessage = this.getElement().getColor() + "" + ChatColor.STRIKETHROUGH + this.getName(); } else { if (bPlayer.getStance() != null && bPlayer.getStance().getName().equals(this.getName())) { displayedMessage = this.getElement().getColor() + "" + ChatColor.UNDERLINE + this.getName();