From 7a76f1d424ac95fcdc91e51294dbf103d558045d Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sun, 16 Jun 2024 11:06:16 +0200 Subject: Added debug command /shtestisland --- src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt | 6 +++++- .../skyhanni/data/hypixel/chat/event/AbstractChatEvent.kt | 2 +- .../skyhanni/features/mining/glacitemineshaft/CorpseLocator.kt | 2 +- .../features/mining/glacitemineshaft/MineshaftWaypoints.kt | 2 +- .../java/at/hannibal2/skyhanni/test/command/TestChatCommand.kt | 10 ++++------ 5 files changed, 12 insertions(+), 10 deletions(-) (limited to 'src/main/java/at') diff --git a/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt index 9aa58f45b..289c9c58b 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt @@ -249,7 +249,11 @@ object MiningAPI { } event.addData { - add("lastInitSound: ${lastInitSound.passedSince().format()}") + if (lastInitSound.isFarPast()) { + add("lastInitSound: never") + } else { + add("lastInitSound: ${lastInitSound.passedSince().format()}") + } add("waitingForInitSound: $waitingForInitSound") add("waitingForInitBlock: $waitingForInitBlock") add("waitingForInitBlockPos: $waitingForInitBlockPos") diff --git a/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/event/AbstractChatEvent.kt b/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/event/AbstractChatEvent.kt index d7dce85c7..6ef6861f2 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/event/AbstractChatEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/event/AbstractChatEvent.kt @@ -10,6 +10,6 @@ open class AbstractChatEvent( var chatComponent: IChatComponent, var blockedReason: String? = null, ) : LorenzEvent() { - val message by lazy { messageComponent.getText() } + val message by lazy { messageComponent.getText().removePrefix("§r") } val author by lazy { authorComponent.getText() } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseLocator.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseLocator.kt index 18750bff5..7a93d528d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseLocator.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseLocator.kt @@ -83,7 +83,7 @@ object CorpseLocator { @SubscribeEvent fun onWorldChange(event: LorenzWorldChangeEvent) { - if (sharedWaypoints.isNotEmpty()) sharedWaypoints.clear() + sharedWaypoints.clear() } @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/MineshaftWaypoints.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/MineshaftWaypoints.kt index 53b0fa001..7476e212b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/MineshaftWaypoints.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/MineshaftWaypoints.kt @@ -26,7 +26,7 @@ object MineshaftWaypoints { private const val BLOCKS_FORWARD: Int = 7 - val waypoints: MutableList = mutableListOf() + val waypoints = mutableListOf() private var timeLastShared = SimpleTimeMark.farPast() @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/TestChatCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/TestChatCommand.kt index 38db097a2..5b36d1863 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/command/TestChatCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/command/TestChatCommand.kt @@ -56,16 +56,14 @@ object TestChatCommand { val event = LorenzChatEvent(message, componentText) event.postAndCatch() + if (isHidden) return + if (event.blockedReason != "") { - if (!isHidden) { - ChatUtils.chat("§cChat blocked: ${event.blockedReason}") - } + ChatUtils.chat("§cChat blocked: ${event.blockedReason}") } else { val finalMessage = event.chatComponent if (finalMessage.formattedText.stripHypixelMessage() != message) { - if (!isHidden) { - ChatUtils.chat("§eChat modified!") - } + ChatUtils.chat("§eChat modified!") } ChatUtils.chat(finalMessage) } -- cgit