aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/garden
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-04-16 20:16:20 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-04-16 20:16:20 +0200
commit4f4838404ad1aa90d35d3059f1d012c0cd7c9a07 (patch)
tree0d47a3662ee2df4c153aba98d2f4a3c391c08a2f /src/main/java/at/hannibal2/skyhanni/features/garden
parentd82f1a825da599650ee2b6aab84a97e90abf4745 (diff)
downloadskyhanni-4f4838404ad1aa90d35d3059f1d012c0cd7c9a07.tar.gz
skyhanni-4f4838404ad1aa90d35d3059f1d012c0cd7c9a07.tar.bz2
skyhanni-4f4838404ad1aa90d35d3059f1d012c0cd7c9a07.zip
Using more regex
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/garden')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenTeleportPadInventoryNumber.kt8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenTeleportPadInventoryNumber.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenTeleportPadInventoryNumber.kt
index 757e03a62..dcb018404 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenTeleportPadInventoryNumber.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenTeleportPadInventoryNumber.kt
@@ -57,10 +57,12 @@ class GardenTeleportPadInventoryNumber {
}
private var inTeleportPad = false
+ private val pattern = "§.(.*) teleport pad".toPattern()
@SubscribeEvent
fun onInventoryOpen(event: InventoryOpenEvent) {
- inTeleportPad = event.inventoryName == "Set Destination" && SkyHanniMod.feature.garden.teleportPadsInventoryNumbers
+ inTeleportPad =
+ event.inventoryName == "Set Destination" && SkyHanniMod.feature.garden.teleportPadsInventoryNumbers
}
@SubscribeEvent
@@ -69,12 +71,10 @@ class GardenTeleportPadInventoryNumber {
if (!inTeleportPad) return
val name = event.stack.name?.lowercase() ?: return
- val pattern = "§.(.*) teleport pad".toPattern()
-
val matcher = pattern.matcher(name)
if (!matcher.matches()) return
- val text = matcher.group(1)
+ val text = matcher.group(1)
numbers[text]?.let {
event.stackTip = "$it"
return