aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni
diff options
context:
space:
mode:
authorWalker Selby <git@walkerselby.com>2023-11-22 12:36:06 +0000
committerGitHub <noreply@github.com>2023-11-22 13:36:06 +0100
commitab4ee55eb6b2951e24c4bed144b2cf68e86501c1 (patch)
tree4ba3c71493b405be1689a7bc3f991bc7c07b4a2d /src/main/java/at/hannibal2/skyhanni
parent12b6f4f5a9d962dc178e1805a5900cb32e50ae34 (diff)
downloadskyhanni-ab4ee55eb6b2951e24c4bed144b2cf68e86501c1.tar.gz
skyhanni-ab4ee55eb6b2951e24c4bed144b2cf68e86501c1.tar.bz2
skyhanni-ab4ee55eb6b2951e24c4bed144b2cf68e86501c1.zip
Extract isOtherTool checks to a list (#726)
Extract isOtherTool checks to a list #726
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt
index 8998903d5..ee590806a 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt
@@ -62,6 +62,17 @@ object GardenAPI {
private val barnArea = AxisAlignedBB(35.5, 70.0, -4.5, -32.5, 100.0, -46.5)
+ // TODO USE SH-REPO
+ private val otherToolsList = listOf(
+ "DAEDALUS_AXE",
+ "BASIC_GARDENING_HOE",
+ "ADVANCED_GARDENING_AXE",
+ "BASIC_GARDENING_AXE",
+ "ADVANCED_GARDENING_HOE",
+ "ROOKIE_HOE",
+ "BINGHOE"
+ )
+
@SubscribeEvent
fun onSendPacket(event: PacketEvent.SendEvent) {
if (!inGarden()) return
@@ -123,19 +134,7 @@ object GardenAPI {
}
private fun isOtherTool(internalName: NEUInternalName): Boolean {
- if (internalName.startsWith("DAEDALUS_AXE")) return true
-
- if (internalName.startsWith("BASIC_GARDENING_HOE")) return true
- if (internalName.startsWith("ADVANCED_GARDENING_AXE")) return true
-
- if (internalName.startsWith("BASIC_GARDENING_AXE")) return true
- if (internalName.startsWith("ADVANCED_GARDENING_HOE")) return true
-
- if (internalName.startsWith("ROOKIE_HOE")) return true
-
- if (internalName.startsWith("BINGHOE")) return true
-
- return false
+ return internalName.asString() in otherToolsList
}
fun inGarden() = IslandType.GARDEN.isInIsland()