aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/OdgerWaypoint.kt30
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/SuperCraftFeatures.kt3
3 files changed, 13 insertions, 24 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt
index 025b4cead..9d3a6253a 100644
--- a/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt
@@ -174,8 +174,8 @@ object GetFromSackAPI {
val itemString = args.dropLast(1).joinToString(" ").uppercase().replace(':', '-')
val item = when {
- sackListInternalNames.contains(itemString) -> itemString.asInternalName()
- sackListNames.contains(itemString) -> NEUInternalName.fromItemNameOrNull(itemString) ?: run {
+ SackAPI.sackListInternalNames.contains(itemString) -> itemString.asInternalName()
+ SackAPI.sackListNames.contains(itemString) -> NEUInternalName.fromItemNameOrNull(itemString) ?: run {
ErrorManager.logErrorStateWithData(
"Couldn't resolve item name",
"Query failed",
diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/OdgerWaypoint.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/OdgerWaypoint.kt
index d26ec6b90..ee9c4b44b 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/OdgerWaypoint.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/OdgerWaypoint.kt
@@ -5,10 +5,11 @@ import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
import at.hannibal2.skyhanni.data.IslandType
import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent
import at.hannibal2.skyhanni.events.LorenzTickEvent
-import at.hannibal2.skyhanni.features.fishing.FishingAPI.isFishingRod
+import at.hannibal2.skyhanni.features.fishing.FishingAPI
import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled
import at.hannibal2.skyhanni.utils.InventoryUtils
-import at.hannibal2.skyhanni.utils.ItemUtils.getLore
+import at.hannibal2.skyhanni.utils.ItemCategory
+import at.hannibal2.skyhanni.utils.ItemUtils.getItemCategoryOrNull
import at.hannibal2.skyhanni.utils.LorenzColor
import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland
import at.hannibal2.skyhanni.utils.LorenzVec
@@ -20,33 +21,20 @@ class OdgerWaypoint {
private val config get() = SkyHanniMod.feature.fishing.trophyFishing
private val location = LorenzVec(-373, 207, -808)
- private var hasLavaRodInHand = false
- private var trophyFishInInv = false
+ private var trophyFishInInventory = false
@SubscribeEvent
fun onTick(event: LorenzTickEvent) {
- if (!isEnabled()) return
-
- if (event.isMod(10)) {
- hasLavaRodInHand = isLavaFishingRod()
-
- trophyFishInInv = InventoryUtils.getItemsInOwnInventory().map { it.getLore() }
- .any { it.isNotEmpty() && it.last().endsWith("TROPHY FISH") }
- }
- }
-
- private fun isLavaFishingRod(): Boolean {
- val heldItem = InventoryUtils.getItemInHand() ?: return false
- if (!heldItem.isFishingRod()) return false
-
- return heldItem.getLore().any { it.contains("Lava Rod") }
+ if (!isEnabled() || !event.isMod(10)) return
+ trophyFishInInventory = InventoryUtils.getItemsInOwnInventory()
+ .any { it.getItemCategoryOrNull() == ItemCategory.TROPHY_FISH }
}
@SubscribeEvent
fun onRenderWorld(event: LorenzRenderWorldEvent) {
if (!isEnabled()) return
- if (hasLavaRodInHand) return
- if (!trophyFishInInv) return
+ if (FishingAPI.holdingLavaRod) return
+ if (!trophyFishInInventory) return
event.drawWaypointFilled(location, LorenzColor.WHITE.toColor())
event.drawDynamicText(location, "Odger", 1.5)
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/SuperCraftFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/SuperCraftFeatures.kt
index a5e504245..9a8a0ba9e 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/SuperCraftFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/SuperCraftFeatures.kt
@@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.features.inventory
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.api.GetFromSackAPI
+import at.hannibal2.skyhanni.data.SackAPI
import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.utils.DelayedRun
import at.hannibal2.skyhanni.utils.NEUInternalName
@@ -24,7 +25,7 @@ class SuperCraftFeatures {
val (internalName, amount) = craftedPattern.matchMatcher(event.message) {
NEUInternalName.fromItemName(this.group("item")) to (this.group("amount")?.formatInt() ?: 1)
} ?: return
- if (!GetFromSackAPI.sackListInternalNames.contains(internalName.asString())) return
+ if (!SackAPI.sackListInternalNames.contains(internalName.asString())) return
DelayedRun.runNextTick {
GetFromSackAPI.getFromChatMessageSackItems(PrimitiveItemStack(internalName, amount))
}