From f1454ea7831976daa615290ea32a369f3ace6216 Mon Sep 17 00:00:00 2001 From: Brandon Date: Wed, 13 Dec 2023 20:13:57 -0400 Subject: 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 --- .../skyhanni/features/event/diana/InquisitorWaypointShare.kt | 3 ++- .../hannibal2/skyhanni/features/misc/PatcherSendCoordinates.kt | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src/main') 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 = "(?.*): x: (?.*), y: (?.*), z: (?.*)".toPattern() + private val pattern = "(?.*): [xX]: (?[0-9.-]+),? [yY]: (?[0-9.-]+),? [zZ]: (?.*)".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") } -- cgit