Added max level lore

This commit is contained in:
Auxilor
2023-09-28 16:19:14 +01:00
parent 2d1d423f83
commit 20d7e3abf7
2 changed files with 15 additions and 1 deletions

View File

@@ -363,6 +363,8 @@ class Pet(
val level = player.getPetLevel(this) val level = player.getPetLevel(this)
val isActive = player.activePet == this val isActive = player.activePet == this
val baseLoreLocation = if (level == this.maxLevel) "max-level-lore" else "lore"
return ItemStackBuilder(base) return ItemStackBuilder(base)
.setDisplayName( .setDisplayName(
plugin.configYml.getFormattedString("gui.pet-icon.name") plugin.configYml.getFormattedString("gui.pet-icon.name")
@@ -370,7 +372,7 @@ class Pet(
.replace("%pet%", this.name) .replace("%pet%", this.name)
) )
.addLoreLines { .addLoreLines {
injectPlaceholdersInto(plugin.configYml.getStrings("gui.pet-icon.lore"), player) + injectPlaceholdersInto(plugin.configYml.getStrings("gui.pet-icon.$baseLoreLocation"), player) +
if (isActive) plugin.configYml.getStrings("gui.pet-icon.active-lore") else if (isActive) plugin.configYml.getStrings("gui.pet-icon.active-lore") else
plugin.configYml.getStrings("gui.pet-icon.not-active-lore") plugin.configYml.getStrings("gui.pet-icon.not-active-lore")
} }

View File

@@ -81,6 +81,18 @@ gui:
- "&8» &e%percentage_progress%%" - "&8» &e%percentage_progress%%"
- "&8» &e%current_xp%&8/&7%required_xp% &fXP" - "&8» &e%current_xp%&8/&7%required_xp% &fXP"
# By default, the lore for the max level is the same,
# but you can change this if you want.
max-level-lore:
- "%description%"
- "&f"
- "&fEffects:"
- "%effects%"
- ""
- "&fProgress:"
- "&8» &e%percentage_progress%%"
- "&8» &e%current_xp%&8/&7%required_xp% &fXP"
active-lore: active-lore:
- "" - ""
- "&cThis pet is already active!" - "&cThis pet is already active!"