diff options
author | Brandon <brandon.wamboldt@gmail.com> | 2023-12-13 20:13:57 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-14 01:13:57 +0100 |
commit | f1454ea7831976daa615290ea32a369f3ace6216 (patch) | |
tree | 4db043e5aa77c1de180c4445e68c6b72df563b59 /src/main | |
parent | 18e663ea673ba938394fdafbb2ed37f2a795da4d (diff) | |
download | skyhanni-f1454ea7831976daa615290ea32a369f3ace6216.tar.gz skyhanni-f1454ea7831976daa615290ea32a369f3ace6216.tar.bz2 skyhanni-f1454ea7831976daa615290ea32a369f3ace6216.zip |
Support Badlion sendcoords format and only show inquisitor waypoints in the hub (#796)
Added Support to read Badlion sendcoords format. Fixed show inquisitor waypoints outside of the hub. #796
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt | 3 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/PatcherSendCoordinates.kt | 10 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt index 5532d70e9..488f7ca09 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.event.diana import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.events.EntityHealthUpdateEvent import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.LorenzKeyPressEvent @@ -216,7 +217,7 @@ object InquisitorWaypointShare { @SubscribeEvent(priority = EventPriority.LOW, receiveCanceled = true) fun onFirstChatEvent(event: PacketEvent.ReceiveEvent) { - if (!isEnabled()) return + if (!isEnabled() || LorenzUtils.skyBlockIsland != IslandType.HUB) return val packet = event.packet if (packet !is S02PacketChat) return val messageComponent = packet.chatComponent diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/PatcherSendCoordinates.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/PatcherSendCoordinates.kt index dbc164fa0..0c985376c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/PatcherSendCoordinates.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/PatcherSendCoordinates.kt @@ -23,7 +23,7 @@ class PatcherSendCoordinates { private val logger = LorenzLogger("misc/patchercoords") // TODO USE SH-REPO - private val pattern = "(?<playerName>.*): x: (?<x>.*), y: (?<y>.*), z: (?<z>.*)".toPattern() + private val pattern = "(?<playerName>.*): [xX]: (?<x>[0-9.-]+),? [yY]: (?<y>[0-9.-]+),? [zZ]: (?<z>.*)".toPattern() @SubscribeEvent fun onPatcherCoordinates(event: LorenzChatEvent) { @@ -32,8 +32,8 @@ class PatcherSendCoordinates { val message = event.message.removeColor() pattern.matchMatcher(message) { var description = group("playerName").split(" ").last() - val x = group("x").toInt() - val y = group("y").toInt() + val x = group("x").toFloat() + val y = group("y").toFloat() val end = group("z") val z = if (end.contains(" ")) { @@ -41,8 +41,8 @@ class PatcherSendCoordinates { val extra = split.drop(1).joinToString(" ") description += " " + extra - split.first().toInt() - } else end.toInt() + split.first().toFloat() + } else end.toFloat() patcherBeacon.add(PatcherBeacon(LorenzVec(x, y, z), description, System.currentTimeMillis() / 1000)) logger.log("got patcher coords and username") } |