diff --git a/fabric/src/main/java/xyz/jpenilla/tabtps/fabric/TabTPSFabricClient.java b/fabric/src/main/java/xyz/jpenilla/tabtps/fabric/TabTPSFabricClient.java index f701df2..5cee29b 100644 --- a/fabric/src/main/java/xyz/jpenilla/tabtps/fabric/TabTPSFabricClient.java +++ b/fabric/src/main/java/xyz/jpenilla/tabtps/fabric/TabTPSFabricClient.java @@ -24,15 +24,16 @@ package xyz.jpenilla.tabtps.fabric; import net.fabricmc.api.ClientModInitializer; -import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents; import xyz.jpenilla.tabtps.common.TabTPS; -public class TabTPSFabricClient implements ClientModInitializer { +public final class TabTPSFabricClient implements ClientModInitializer { @Override public void onInitializeClient() { - ClientLifecycleEvents.CLIENT_STOPPING.register(minecraft -> { + final Thread thread = new Thread(() -> { final TabTPS tabTPS = TabTPSFabric.get().tabTPS(); tabTPS.shutdown(); }); + thread.setName("TabTPS-Client-Shutdown-Thread"); + Runtime.getRuntime().addShutdownHook(thread); } } diff --git a/neoforge/src/main/java/xyz/jpenilla/tabtps/neoforge/TabTPSNeoForgeClient.java b/neoforge/src/main/java/xyz/jpenilla/tabtps/neoforge/TabTPSNeoForgeClient.java index 9e80723..9041bea 100644 --- a/neoforge/src/main/java/xyz/jpenilla/tabtps/neoforge/TabTPSNeoForgeClient.java +++ b/neoforge/src/main/java/xyz/jpenilla/tabtps/neoforge/TabTPSNeoForgeClient.java @@ -30,9 +30,11 @@ @Mod(value = "tabtps", dist = Dist.CLIENT) public final class TabTPSNeoForgeClient { public TabTPSNeoForgeClient() { - Runtime.getRuntime().addShutdownHook(new Thread(() -> { + final Thread thread = new Thread(() -> { final TabTPS tabTPS = TabTPSNeoForge.get().tabTPS(); tabTPS.shutdown(); - })); + }); + thread.setName("TabTPS-Client-Shutdown-Thread"); + Runtime.getRuntime().addShutdownHook(thread); } }