aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-11 21:11:46 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-11 21:11:46 +0100
commit1cfd0512dbc2a85a26cafddbf19ac7be7f1b166d (patch)
tree66cac7eac2889f0b9b48c2189800ec86d82ce5c7
parent9a5d44a2a68a20429b5d66328f1e2a3a7cfca03b (diff)
downloadskyhanni-1cfd0512dbc2a85a26cafddbf19ac7be7f1b166d.tar.gz
skyhanni-1cfd0512dbc2a85a26cafddbf19ac7be7f1b166d.tar.bz2
skyhanni-1cfd0512dbc2a85a26cafddbf19ac7be7f1b166d.zip
code cleanup
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/stranded/HighlightPlaceableNpcs.kt10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/stranded/HighlightPlaceableNpcs.kt b/src/main/java/at/hannibal2/skyhanni/features/stranded/HighlightPlaceableNpcs.kt
index 52c450ca4..edf80be69 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/stranded/HighlightPlaceableNpcs.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/stranded/HighlightPlaceableNpcs.kt
@@ -9,11 +9,12 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getLore
import at.hannibal2.skyhanni.utils.LorenzColor
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.RenderUtils.highlight
+import at.hannibal2.skyhanni.utils.StringUtils.matches
import net.minecraftforge.fml.common.eventhandler.EventPriority
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class HighlightPlaceableNpcs {
- private val config get() = SkyHanniMod.feature.stranded.highlightPlaceableNpcs
+ private val config get() = SkyHanniMod.feature.stranded
private val locationPattern = "§7Location: §f\\[§e\\d+§f, §e\\d+§f, §e\\d+§f]".toPattern()
private var inInventory = false
@@ -59,11 +60,8 @@ class HighlightPlaceableNpcs {
}
// Checking if is already placed
- for (line in lore) {
- if (locationPattern.matcher(line).matches()) return false
- }
- return true
+ return lore.none { locationPattern.matches(it) }
}
- private fun isEnabled() = LorenzUtils.inSkyBlock && config
+ private fun isEnabled() = LorenzUtils.inSkyBlock && LorenzUtils.isStrandedProfile && config.highlightPlaceableNpcs
}