aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-06-22 18:12:22 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-06-22 18:12:22 +0200
commitd7deab0722473761b6e8d4c66a03d889f350a685 (patch)
tree7284707b9b2cb3b8d330e5ef3d302773ad777806 /src/main/java/at/hannibal2/skyhanni/features
parent25962a047b310662f923917d96cd96a1d3a16965 (diff)
downloadskyhanni-d7deab0722473761b6e8d4c66a03d889f350a685.tar.gz
skyhanni-d7deab0722473761b6e8d4c66a03d889f350a685.tar.bz2
skyhanni-d7deab0722473761b6e8d4c66a03d889f350a685.zip
Fixed Shy warning problem with not using main thread
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/CruxWarnings.kt9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/CruxWarnings.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/CruxWarnings.kt
index 509ed4979..295104caa 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/CruxWarnings.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/CruxWarnings.kt
@@ -2,17 +2,18 @@ package at.hannibal2.skyhanni.features.rift
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.data.TitleUtils
+import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.test.command.CopyErrorCommand
import at.hannibal2.skyhanni.utils.LocationUtils.distanceToPlayer
import net.minecraft.client.Minecraft
-import kotlin.concurrent.fixedRateTimer
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class CruxWarnings {
private val shyNames = arrayOf("I'm ugly! :(", "Eek!", "Don't look at me!", "Look away!")
- init {
- fixedRateTimer(name = "skyhanni-shywarner-timer", period = 250) {
- Minecraft.getMinecraft().thePlayer ?: return@fixedRateTimer
+ @SubscribeEvent
+ fun onTick(event: LorenzTickEvent) {
+ if (event.isMod(2)) {
checkForShy()
}
}