aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/misc
diff options
context:
space:
mode:
authorsaga <45262877+saga-00@users.noreply.github.com>2024-08-31 16:26:47 -0300
committerGitHub <noreply@github.com>2024-08-31 21:26:47 +0200
commitc834fbbb6a535b0c0c27d02c893433e687332268 (patch)
tree7dec3d26fd4b90c02a0286ea84aeff3f7760fe3d /src/main/java/at/hannibal2/skyhanni/features/misc
parent31f9e29c0aa055b615d1eaaf7bca9d8d10b0ba7e (diff)
downloadskyhanni-c834fbbb6a535b0c0c27d02c893433e687332268.tar.gz
skyhanni-c834fbbb6a535b0c0c27d02c893433e687332268.tar.bz2
skyhanni-c834fbbb6a535b0c0c27d02c893433e687332268.zip
Feature: /shtps command (#1961)
Co-authored-by: Cal <cwolfson58@gmail.com> Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/misc')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/TpsCounter.kt11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/TpsCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/TpsCounter.kt
index 0c6521e9c..ed6d3f63c 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/TpsCounter.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/TpsCounter.kt
@@ -8,6 +8,7 @@ import at.hannibal2.skyhanni.events.GuiRenderEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.events.minecraft.packet.PacketReceivedEvent
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
+import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzUtils.round
import at.hannibal2.skyhanni.utils.RenderUtils.renderString
@@ -32,7 +33,7 @@ object TpsCounter {
init {
// TODO use SecondPassedEvent + passedSince
fixedRateTimer(name = "skyhanni-tps-counter-seconds", period = 1000L) {
- if (!isEnabled()) return@fixedRateTimer
+ if (!LorenzUtils.inSkyBlock) return@fixedRateTimer
if (packetsFromLastSecond == 0) return@fixedRateTimer
if (ignoreFirstTicks > 0) {
@@ -62,7 +63,7 @@ object TpsCounter {
}
// TODO use DelayedRun
fixedRateTimer(name = "skyhanni-tps-counter-ticks", period = 50L) {
- if (!isEnabled()) return@fixedRateTimer
+ if (!LorenzUtils.inSkyBlock) return@fixedRateTimer
if (hasPacketReceived) {
hasPacketReceived = false
@@ -71,6 +72,10 @@ object TpsCounter {
}
}
+ fun tpsCommand() {
+ ChatUtils.chat(display)
+ }
+
@SubscribeEvent
fun onWorldChange(event: LorenzWorldChangeEvent) {
tpsList.clear()
@@ -81,7 +86,7 @@ object TpsCounter {
@HandleEvent(priority = HandleEvent.LOW, receiveCancelled = true)
fun onPacketReceive(event: PacketReceivedEvent) {
- if (!config.tpsDisplay) return
+ if (!LorenzUtils.inSkyBlock) return
hasPacketReceived = true
}