Added placeholder %mmocore_cooldown_bound_<slot>% according to issue #890.

This commit is contained in:
Ka0rX 2023-07-09 22:05:22 +01:00
parent 65d6047017
commit a76d77fe47

View File

@ -129,9 +129,17 @@ public class RPGPlaceholders extends PlaceholderExpansion {
else if (identifier.startsWith("bound_")) { else if (identifier.startsWith("bound_")) {
int slot = Math.max(0, Integer.parseInt(identifier.substring(6))); int slot = Math.max(0, Integer.parseInt(identifier.substring(6)));
return playerData.hasSkillBound(slot) ? playerData.getBoundSkill(slot).getSkill().getName() if (playerData.hasSkillBound(slot)) {
: MMOCore.plugin.configManager.noSkillBoundPlaceholder; ClassSkill skill = playerData.getBoundSkill(slot);
return (playerData.getCooldownMap().isOnCooldown(skill) ? ChatColor.RED : ChatColor.GREEN) + skill.getSkill().getName();
} else
return MMOCore.plugin.configManager.noSkillBoundPlaceholder;
} else if (identifier.startsWith("cooldown_bound_")) {
int slot = Math.max(0, Integer.parseInt(identifier.substring(15)));
if (playerData.hasSkillBound(slot))
return "" + playerData.getCooldownMap().getCooldown(playerData.getBoundSkill(slot));
else
return MMOCore.plugin.configManager.noSkillBoundPlaceholder;
} else if (identifier.startsWith("profession_experience_")) } else if (identifier.startsWith("profession_experience_"))
return MythicLib.plugin.getMMOConfig().decimal.format( return MythicLib.plugin.getMMOConfig().decimal.format(
playerData.getCollectionSkills().getExperience(identifier.substring(22).replace(" ", "-").replace("_", "-").toLowerCase())); playerData.getCollectionSkills().getExperience(identifier.substring(22).replace(" ", "-").replace("_", "-").toLowerCase()));