Fixed issue #809 about passive skill being shown in the skill casting bar.

This commit is contained in:
Ka0rX 2023-05-04 09:40:25 +01:00
parent edc873a6c7
commit d2d03e322c

View File

@ -119,11 +119,12 @@ public class SkillBar implements Listener {
if (!data.isOnline()) return str.toString(); if (!data.isOnline()) return str.toString();
for (int slot : data.mapBoundSkills().keySet()) { for (int slot : data.mapBoundSkills().keySet()) {
ClassSkill skill = data.getBoundSkill(slot); ClassSkill skill = data.getBoundSkill(slot);
str.append(str.isEmpty() ? "" : split).append((onCooldown(data, skill) ? onCooldown.replace("{cooldown}", if (!skill.getSkill().getTrigger().isPassive())
String.valueOf(data.getCooldownMap().getInfo(skill).getRemaining() / 1000)) : noMana(data, skill) ? noMana : (noStamina( str.append(str.isEmpty() ? "" : split).append((onCooldown(data, skill) ? onCooldown.replace("{cooldown}",
data, skill) ? noStamina : ready)).replace("{index}", String.valueOf(data.getCooldownMap().getInfo(skill).getRemaining() / 1000)) : noMana(data, skill) ? noMana : (noStamina(
String.valueOf(slot + (data.getPlayer().getInventory().getHeldItemSlot() < slot ? 1 : 0))) data, skill) ? noStamina : ready)).replace("{index}",
.replace("{skill}", data.getBoundSkill(slot).getSkill().getName())); String.valueOf(slot + (data.getPlayer().getInventory().getHeldItemSlot() < slot ? 1 : 0)))
.replace("{skill}", data.getBoundSkill(slot).getSkill().getName()));
} }
return MMOCore.plugin.placeholderParser.parse(data.getPlayer(), str.toString()); return MMOCore.plugin.placeholderParser.parse(data.getPlayer(), str.toString());
} }