From bd9b82fcd881277a102a01926058c380e205edba Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 8 May 2023 10:45:20 +0200 Subject: Minotaur and Minos Champion no longer count as Inquisitor, added Inquis test command --- .../hannibal2/skyhanni/config/commands/Commands.kt | 1 + .../event/diana/InquisitorWaypointShare.kt | 22 +++++++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt index 9c5e3e04e..1e22403ab 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt @@ -70,6 +70,7 @@ object Commands { registerCommand("shtestbingo") { TestBingo.toggle() } registerCommand("shtestmessage") { TestChatCommand.command(it) } registerCommand("shshareinquis") { InquisitorWaypointShare.sendInquisitor() } + registerCommand("shtestinquisitor") { InquisitorWaypointShare.test() } } private fun registerCommand(name: String, function: (Array) -> Unit) { 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 abf402f3e..40ff00a12 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 @@ -25,7 +25,8 @@ import org.lwjgl.input.Keyboard object InquisitorWaypointShare { private val config get() = SkyHanniMod.feature.diana.inquisitorSharing - private val partyPattern = "§9Party §8> (?.*)§f: §rx: (?-?[0-9]{1,4}), y: (?-?[0-9]{1,4}), z: (?-?[0-9]{1,4})\\b".toPattern() + private val partyPattern = + "§9Party §8> (?.*)§f: §rx: (?-?[0-9]{1,4}), y: (?-?[0-9]{1,4}), z: (?-?[0-9]{1,4})\\b".toPattern() private val diedPattern = "§9Party §8> (?.*)§f: §rInquisitor dead!".toPattern() private var time = 0L @@ -41,6 +42,13 @@ object InquisitorWaypointShare { var waypoints = mapOf() + private var test = false + + fun test() { + test = !test + LorenzUtils.chat("§e[SkyHanni] Inquisitor Test " + if (test) "Enabled" else "Disabled") + } + @SubscribeEvent fun onTick(event: TickEvent.ClientTickEvent) { if (event.phase != TickEvent.Phase.START) return @@ -61,10 +69,6 @@ object InquisitorWaypointShare { fun onChatMessage(event: LorenzChatEvent) { if (!isEnabled()) return val message = event.message - // TODO use inquisitor -// if (message.endsWith("§r§eYou dug out §r§2a Minotaur§r§e!")) { - - if (message.contains("§eYou dug out")) { testTime = System.currentTimeMillis() lastInquisitorMessage = message @@ -95,10 +99,10 @@ object InquisitorWaypointShare { val entity = event.entity if (entity !is EntityOtherPlayerMP) return val name = entity.name - // TODO change - if (name != "Minos Inquisitor" && name != "Minotaur " && name != "Minos Champion") { -// if (name != "Minos Inquisitor") { - return + if (test) { + if (name != "Minos Inquisitor" && name != "Minotaur " && name != "Minos Champion") return + } else { + if (name != "Minos Inquisitor") return } logger.log("FOUND: $name") -- cgit