Skip to content

Commit

Permalink
Merge branch 'Auxilor:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
LangZongz authored Nov 12, 2023
2 parents f2b00b0 + bae5d61 commit b2d7a6a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ class EnchantDisplay(private val plugin: EcoEnchantsPlugin) : DisplayModule(plug
val enchantLevel = enchant.getLevel(level)
val holder = ItemProvidedHolder(enchantLevel, itemStack)

val enchantNotMetLines = enchantLevel.conditions.getNotMetLines(player, holder).map { Display.PREFIX + it }
val enchantNotMetLines = holder.getNotMetLines(player).map { Display.PREFIX + it }
notMetLines.addAll(enchantNotMetLines)

if (enchantNotMetLines.isNotEmpty() || enchantLevel.conditions.isShowingAnyNotMet(player, holder)) {
if (enchantNotMetLines.isNotEmpty() || holder.isShowingAnyNotMet(player)) {
showNotMet = true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ object DisplayCache {

data class DisplayableEnchant(
val enchant: EcoEnchantLike,
val level: Int
val level: Int,
val showNotMet: Boolean = false
)

@JvmOverloads
Expand All @@ -35,7 +36,7 @@ fun EcoEnchantLike.getFormattedName(
): String {
val plugin = EcoEnchantsPlugin.instance

return DisplayCache.nameCache.get(DisplayableEnchant(this, level)) {
return DisplayCache.nameCache.get(DisplayableEnchant(this, level, showNotMet)) {
val numerals = plugin.configYml.getBool("display.numerals.enabled") &&
level <= plugin.configYml.getInt("display.numerals.threshold")

Expand Down
2 changes: 1 addition & 1 deletion eco-core/core-plugin/src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ display:
enabled: true # If enchantments should be collapsed in lore
threshold: 9 # Above this amount, enchantments will be collapsed
per-line: 2 # The amount of enchantments to put in each line
delimiter: ", " # The delimiter between enchantments
delimiter: ",&r " # The delimiter between enchantments

descriptions:
enabled: true # If enchantment descriptions should be shown in lore
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#libreforge-updater
#Fri Nov 10 13:59:43 GMT 2023
#Sat Nov 11 17:59:12 GMT 2023
kotlin.code.style=official
libreforge-version=4.41.0
version=10.43.0
libreforge-version=4.42.0
version=10.44.0

0 comments on commit b2d7a6a

Please sign in to comment.