Added %mmocore_bound<1-to-6>% placeholder

This commit is contained in:
Indyuce 2020-05-01 19:16:54 +02:00
parent dc97cbeac9
commit 4453525900
3 changed files with 10 additions and 1 deletions

View File

@ -62,6 +62,13 @@ public class RPGPlaceholders
return MMOCore.plugin.configManager.decimal.format(current / next * 100);
}
else if (identifier.startsWith("bound_")) {
int slot = Math.max(0, Integer.parseInt(identifier.substring(6)) - 1);
PlayerData playerData = PlayerData.get(player);
return playerData.hasSkillBound(slot) ? playerData.getBoundSkill(slot).getSkill().getName()
: MMOCore.plugin.configManager.noSkillBoundPlaceholder;
}
else if (identifier.startsWith("profession_"))
return "" + PlayerData.get(player).getCollectionSkills()
.getLevel(identifier.substring(11).replace(" ", "-").replace("_", "-").toLowerCase());

View File

@ -25,7 +25,7 @@ public class ConfigManager {
public boolean overrideVanillaExp, hotbarSwap;
public double expPartyBuff, regenPartyBuff;
public String partyChatPrefix;
public String partyChatPrefix, noSkillBoundPlaceholder;
public ChatColor staminaFull, staminaHalf, staminaEmpty;
public int combatLogTimer, lootChestExpireTime;
@ -101,6 +101,7 @@ public class ConfigManager {
formatSymbols.setDecimalSeparator(getFirstChar(MMOCore.plugin.getConfig().getString("number-format.decimal-separator"), ','));
combatLogTimer = MMOCore.plugin.getConfig().getInt("combat-log.timer");
lootChestExpireTime = Math.max(MMOCore.plugin.getConfig().getInt("loot-chest-expire-time"), 1) * 1000;
noSkillBoundPlaceholder = getSimpleMessage("no-skill-placeholder").message();
staminaFull = getColorOrDefault("stamina-whole", ChatColor.GREEN);
staminaHalf = getColorOrDefault("stamina-half", ChatColor.DARK_GREEN);

View File

@ -163,3 +163,4 @@ not-unlocked-skill: '&cYou have not unlocked that skill yet.'
no-skill-bound: '&cYou don''t have any skill bound to this slot.'
not-active-skill: '&cThis is not an active skill.'
skill-max-level-hit: '&cYou already hit the max level for that skill.'
no-skill-placeholder: 'No Skill Bound'