mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-12-22 16:05:01 +00:00
Add getMovePreviewWithoutCooldownTimer (#1074)
## Additions * Adds `GeneralMethods::getMovePreviewWithoutCooldownTimer(Player)`
This commit is contained in:
parent
10ac727eda
commit
f0dc7ce32b
1 changed files with 12 additions and 2 deletions
|
@ -828,10 +828,20 @@ public abstract class CoreAbility implements Ability {
|
||||||
|
|
||||||
public String getMovePreview(final Player player) {
|
public String getMovePreview(final Player player) {
|
||||||
final BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player);
|
final BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player);
|
||||||
String displayedMessage = "";
|
String displayedMessage = getMovePreviewWithoutCooldownTimer(player);
|
||||||
if (bPlayer.isOnCooldown(this)) {
|
if (bPlayer.isOnCooldown(this)) {
|
||||||
final long cooldown = bPlayer.getCooldown(this.getName()) - System.currentTimeMillis();
|
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 {
|
} else {
|
||||||
if (bPlayer.getStance() != null && bPlayer.getStance().getName().equals(this.getName())) {
|
if (bPlayer.getStance() != null && bPlayer.getStance().getName().equals(this.getName())) {
|
||||||
displayedMessage = this.getElement().getColor() + "" + ChatColor.UNDERLINE + this.getName();
|
displayedMessage = this.getElement().getColor() + "" + ChatColor.UNDERLINE + this.getName();
|
||||||
|
|
Loading…
Reference in a new issue