Skip to content
This repository was archived by the owner on Oct 4, 2024. It is now read-only.

Commit b63871b

Browse files
committed
Fix hang on System.exit() due to shutdown hook waiting for server stop
1 parent faa9512 commit b63871b

File tree

1 file changed

+14
-0
lines changed
  • src/integrationTest/java/io/github/opencubicchunks/cubicchunks/test/mixin/server

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package io.github.opencubicchunks.cubicchunks.test.mixin.server;
2+
3+
import net.minecraft.server.Main;
4+
import org.spongepowered.asm.mixin.Mixin;
5+
import org.spongepowered.asm.mixin.injection.At;
6+
import org.spongepowered.asm.mixin.injection.Redirect;
7+
8+
@Mixin(Main.class)
9+
public class MixinMain {
10+
@Redirect(method = "main", at = @At(value = "INVOKE", target = "Ljava/lang/Runtime;addShutdownHook(Ljava/lang/Thread;)V"), remap = false)
11+
private static void noShutdownHook(Runtime instance, Thread hook) {
12+
// Do nothing
13+
}
14+
}

0 commit comments

Comments
 (0)