diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/stranded/HighlightPlaceableNpcs.kt | 10 |
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 } |