From 1cfd0512dbc2a85a26cafddbf19ac7be7f1b166d Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 11 Dec 2023 21:11:46 +0100 Subject: code cleanup --- .../skyhanni/features/stranded/HighlightPlaceableNpcs.kt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src') 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 } -- cgit