From 197f404ed7a358b7ec703330da7206c672db8472 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Fri, 20 Aug 2021 19:41:52 +0100 Subject: [PATCH] GUI improvements --- .../main/java/com/willfp/ecoskills/skills/Skills.java | 4 ++++ .../src/main/kotlin/com/willfp/ecoskills/skills/Skill.kt | 9 +++++---- eco-core/core-plugin/src/main/resources/config.yml | 9 +++++++++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoskills/skills/Skills.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoskills/skills/Skills.java index 3fc75bd..abd7e12 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoskills/skills/Skills.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoskills/skills/Skills.java @@ -61,4 +61,8 @@ public class Skills { skill.update(); } } + + static { + update(); + } } diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/Skill.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/Skill.kt index cd6f601..14c8fb0 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/Skill.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/Skill.kt @@ -87,20 +87,21 @@ abstract class Skill( NumberUtils.toNumeral(player.getSkillLevel(this)) ) ).addLoreLines { + val currentXP = player.getSkillProgress(this) + val requiredXP = this.getExpForLevel(player.getSkillLevel(this) + 1) val lore: MutableList = ArrayList() for (string in plugin.configYml.getStrings("gui.skill-icon.lore", false)) { lore.add( StringUtils.format( string.replace("%description%", description) - .replace("%current_xp%", player.getSkillProgress(this).toString()) + .replace("%current_xp%", NumberUtils.format(currentXP)) .replace( "%required_xp%", - this.getExpForLevel(player.getSkillLevel(this) + 1).toString() + NumberUtils.format(requiredXP.toDouble()) ) .replace( "%percentage_progress%", - ((this.getExpForLevel(player.getSkillLevel(this) + 1) / player.getSkillLevel(this)) * 100) - .toString() + "%" + NumberUtils.format((currentXP / requiredXP) * 100) + "%" ), player ) diff --git a/eco-core/core-plugin/src/main/resources/config.yml b/eco-core/core-plugin/src/main/resources/config.yml index 16e08d3..babde4f 100644 --- a/eco-core/core-plugin/src/main/resources/config.yml +++ b/eco-core/core-plugin/src/main/resources/config.yml @@ -148,6 +148,7 @@ skills: column: 3 gui-lore: - "&7Primary Stat: %ecoskills_defense_name%" + - "&f" - "&7Ability Levels:" - " &6Versatile Tools %ecoskills_versatile_tools_numeral%" @@ -201,6 +202,7 @@ skills: gui-lore: - "&7Primary Stat: %ecoskills_strength_name%" - "&7Secondary Stat: %ecoskills_crit_damage_name%" + - "&f" - "&7Ability Levels:" - " &6Serrated Strikes %ecoskills_serrated_strikes_numeral%" @@ -228,6 +230,7 @@ skills: gui-lore: - "&7Primary Stat: %ecoskills_wisdom_name%" - "&7Secondary Stat: %ecoskills_crit_chance_name%" + - "&f" - "&7Ability Levels:" - " &6Second Chance %ecoskills_second_chance_numeral%" @@ -254,6 +257,7 @@ skills: gui-lore: - "&7Primary Stat: %ecoskills_crit_damage_name%" - "&7Secondary Stat: %ecoskills_wisdom_name%" + - "&f" - "&7Ability Levels:" - " &6Bountiful Harvest %ecoskills_bountiful_harvest_numeral%" @@ -292,6 +296,7 @@ skills: gui-item: jungle_sapling gui-lore: - "&7Primary Stat: %ecoskills_strength_name%" + - "&f" - "&7Ability Levels:" - " &6Craftsmanship %ecoskills_craftsmanship_numeral%" @@ -325,6 +330,7 @@ skills: gui-lore: - "&7Primary Stat: %ecoskills_defense_name%" - "&7Secondary Stat: %ecoskills_wisdom_name%" + - "&f" - "&7Ability Levels:" - " &6Eye of the Depths %ecoskills_eye_of_the_depths_numeral%" @@ -352,6 +358,7 @@ skills: gui-lore: - "&7Primary Stat: %ecoskills_crit_chance_name%" - "&7Secondary Stat: %ecoskills_wisdom_name%" + - "&f" - "&7Ability Levels:" - " &6Potionmaster %ecoskills_potionmaster_numeral%" @@ -396,6 +403,7 @@ skills: gui-lore: - "&7Primary Stat: %ecoskills_defense_name%" - "&7Secondary Stat: %ecoskills_speed_name%" + - "&f" - "&7Ability Levels:" - " &6Shamanism %ecoskills_shamanism_numeral%" @@ -422,6 +430,7 @@ skills: column: 7 gui-lore: - "&7Primary Stat: %ecoskills_speed_name%" + - "&f" - "&7Ability Levels:" - " &6Seamless Movement %ecoskills_seamless_movement_numeral%"