From ccd7b5cc278ef9140c797d1ca9239f4a53f57425 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Sun, 22 Jan 2023 16:43:59 +0000 Subject: [PATCH] Fixed performance issue --- build.gradle | 2 +- .../com/willfp/ecoenchants/display/EnchantDisplay.kt | 9 ++------- gradle.properties | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/build.gradle b/build.gradle index 7df1623c..98a6b517 100644 --- a/build.gradle +++ b/build.gradle @@ -46,7 +46,7 @@ allprojects { dependencies { compileOnly 'com.willfp:eco:6.44.0' - implementation 'com.willfp:libreforge:3.127.3' + implementation 'com.willfp:libreforge:3.127.4' implementation 'org.joml:joml:1.10.4' compileOnly 'org.jetbrains:annotations:23.0.0' diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/display/EnchantDisplay.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/display/EnchantDisplay.kt index 1f69871b..f20fd8f8 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/display/EnchantDisplay.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/display/EnchantDisplay.kt @@ -80,14 +80,9 @@ class EnchantDisplay(private val plugin: EcoEnchantsPlugin) : DisplayModule(plug val enchantNotMetLines = enchantLevel.getNotMetLines(player).map { Display.PREFIX + it } notMetLines.addAll(enchantNotMetLines) - if (enchantNotMetLines.isNotEmpty()) { - showNotMet = true - } - if (!showNotMet && !enchantLevel.conditions.isMet(player)) { // I know it's slow! I'll fix it. - if (enchantLevel.conditions.any { it.notMetEffects.isNotEmpty() }) { - showNotMet = true - } + if (enchantNotMetLines.isNotEmpty() || enchantLevel.showAnyNotMet(player)) { + showNotMet = true } } diff --git a/gradle.properties b/gradle.properties index 2180fa98..6b6693b0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ #libreforge-updater #Tue Jan 17 16:49:41 GMT 2023 -version=9.15.6 +version=9.15.7 plugin-name=EcoEnchants