summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/test
diff options
context:
space:
mode:
authorCalMWolfs <94038482+CalMWolfs@users.noreply.github.com>2024-09-08 07:03:51 +1000
committerGitHub <noreply@github.com>2024-09-07 23:03:51 +0200
commitd09480c3d272f270fb1b45c51bc3540b5416c09a (patch)
tree0a30b107c3cddb2bcfa80cb5318ef621fe3f8d5c /src/main/java/at/hannibal2/skyhanni/test
parent88416edd2f5a50e1ba88e9adb574e3c60c49abca (diff)
downloadskyhanni-d09480c3d272f270fb1b45c51bc3540b5416c09a.tar.gz
skyhanni-d09480c3d272f270fb1b45c51bc3540b5416c09a.tar.bz2
skyhanni-d09480c3d272f270fb1b45c51bc3540b5416c09a.zip
Backend: Use on DelayedRun to add scheduled tasks (#2462)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/test')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/hotswap/HotswapSupportImpl.kt4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/hotswap/HotswapSupportImpl.kt b/src/main/java/at/hannibal2/skyhanni/test/hotswap/HotswapSupportImpl.kt
index a42a10faf..6e497efca 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/hotswap/HotswapSupportImpl.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/hotswap/HotswapSupportImpl.kt
@@ -2,12 +2,12 @@ package at.hannibal2.skyhanni.test.hotswap
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.utils.ChatUtils
+import at.hannibal2.skyhanni.utils.DelayedRun
import at.hannibal2.skyhanni.utils.ReflectionUtils.makeAccessible
import at.hannibal2.skyhanni.utils.ReflectionUtils.removeFinal
import moe.nea.hotswapagentforge.forge.ClassDefinitionEvent
import moe.nea.hotswapagentforge.forge.HotswapEvent
import moe.nea.hotswapagentforge.forge.HotswapFinishedEvent
-import net.minecraft.client.Minecraft
import net.minecraftforge.common.MinecraftForge
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@@ -22,7 +22,7 @@ class HotswapSupportImpl : HotswapSupportHandle {
fun onHotswapClass(event: ClassDefinitionEvent.Redefinition) {
val instance = SkyHanniMod.modules.find { it.javaClass.name == event.fullyQualifiedName } ?: return
val primaryConstructor = runCatching { instance.javaClass.getDeclaredConstructor() }.getOrNull()
- Minecraft.getMinecraft().addScheduledTask {
+ DelayedRun.onThread.execute {
ChatUtils.chat("Refreshing event subscriptions for module $instance!")
MinecraftForge.EVENT_BUS.unregister(instance)
if (primaryConstructor == null) {