aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/nether
diff options
context:
space:
mode:
authorCalMWolfs <94038482+CalMWolfs@users.noreply.github.com>2024-03-06 19:44:41 +1100
committerGitHub <noreply@github.com>2024-03-06 09:44:41 +0100
commit30b3b6951ca9a29dd0ba27e0f34efad3b05a4aa4 (patch)
treeaed7083057192eed264f3edc614e5aaae7e2cf28 /src/main/java/at/hannibal2/skyhanni/features/nether
parent82a00ed51d55d2be7d65d24c2e93e797cab33864 (diff)
downloadskyhanni-30b3b6951ca9a29dd0ba27e0f34efad3b05a4aa4.tar.gz
skyhanni-30b3b6951ca9a29dd0ba27e0f34efad3b05a4aa4.tar.bz2
skyhanni-30b3b6951ca9a29dd0ba27e0f34efad3b05a4aa4.zip
Backend: Use more isInIsland (#1107)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/nether')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailykuudra/DailyKuudraBossHelper.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt9
4 files changed, 9 insertions, 12 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt
index 28a23a962..bb12afda2 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt
@@ -29,7 +29,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class CrimsonIsleReputationHelper(skyHanniMod: SkyHanniMod) {
- val config get() = SkyHanniMod.feature.crimsonIsle.reputationHelper
+ private val config get() = SkyHanniMod.feature.crimsonIsle.reputationHelper
val questHelper = DailyQuestHelper(this)
val miniBossHelper = DailyMiniBossHelper(this)
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailykuudra/DailyKuudraBossHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailykuudra/DailyKuudraBossHelper.kt
index f8979a57a..977085457 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailykuudra/DailyKuudraBossHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailykuudra/DailyKuudraBossHelper.kt
@@ -13,6 +13,7 @@ import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.CollectionUtils.addAsSingletonList
import at.hannibal2.skyhanni.utils.LorenzColor
import at.hannibal2.skyhanni.utils.LorenzUtils
+import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland
import at.hannibal2.skyhanni.utils.LorenzVec
import at.hannibal2.skyhanni.utils.NEUItems.getItemStack
import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText
@@ -29,9 +30,8 @@ class DailyKuudraBossHelper(private val reputationHelper: CrimsonIsleReputationH
@SubscribeEvent
fun onRenderWorld(event: LorenzRenderWorldEvent) {
- if (!LorenzUtils.inSkyBlock) return
- if (LorenzUtils.skyBlockIsland != IslandType.CRIMSON_ISLE) return
- if (!reputationHelper.config.enabled) return
+ if (!IslandType.CRIMSON_ISLE.isInIsland()) return
+ if (!config.enabled) return
if (!reputationHelper.showLocations()) return
if (allKuudraDone) return
@@ -44,7 +44,7 @@ class DailyKuudraBossHelper(private val reputationHelper: CrimsonIsleReputationH
@SubscribeEvent
fun onChat(event: LorenzChatEvent) {
if (!LorenzUtils.inKuudraFight) return
- if (!reputationHelper.config.enabled) return
+ if (!config.enabled) return
val message = event.message
if (!message.contains("KUUDRA DOWN!") || message.contains(":")) return
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt
index 4de3c1bb9..89ff65e5c 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt
@@ -314,5 +314,5 @@ class DailyQuestHelper(val reputationHelper: CrimsonIsleReputationHelper) {
}
}
- private fun isEnabled() = IslandType.CRIMSON_ISLE.isInIsland() && reputationHelper.config.enabled
+ private fun isEnabled() = IslandType.CRIMSON_ISLE.isInIsland() && config.enabled
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt
index 5feda5c8d..257e5d9b2 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt
@@ -14,7 +14,6 @@ import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled
import at.hannibal2.skyhanni.utils.CollectionUtils.addAsSingletonList
import at.hannibal2.skyhanni.utils.LocationUtils
import at.hannibal2.skyhanni.utils.LorenzColor
-import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland
import at.hannibal2.skyhanni.utils.NEUItems.getItemStack
import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText
@@ -28,8 +27,7 @@ class DailyMiniBossHelper(private val reputationHelper: CrimsonIsleReputationHel
@SubscribeEvent
fun onChat(event: LorenzChatEvent) {
- if (!IslandType.CRIMSON_ISLE.isInIsland()) return
- if (!reputationHelper.config.enabled) return
+ if (!isEnabled()) return
val message = event.message
for (miniBoss in miniBosses) {
@@ -41,9 +39,7 @@ class DailyMiniBossHelper(private val reputationHelper: CrimsonIsleReputationHel
@SubscribeEvent
fun onRenderWorld(event: LorenzRenderWorldEvent) {
- if (!LorenzUtils.inSkyBlock) return
- if (LorenzUtils.skyBlockIsland != IslandType.CRIMSON_ISLE) return
- if (!reputationHelper.config.enabled) return
+ if (!isEnabled()) return
if (!reputationHelper.showLocations()) return
val playerLocation = LocationUtils.playerLocation()
@@ -119,4 +115,5 @@ class DailyMiniBossHelper(private val reputationHelper: CrimsonIsleReputationHel
}
private fun getByDisplayName(name: String) = miniBosses.firstOrNull { it.displayName == name }
+ private fun isEnabled() = IslandType.CRIMSON_ISLE.isInIsland() && config.enabled
}