File tree Expand file tree Collapse file tree
java/wearblackallday/dimthread Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package wearblackallday .dimthread .mixin ;
2+
3+ import net .minecraft .server .dedicated .MinecraftDedicatedServer ;
4+ import org .spongepowered .asm .mixin .Mixin ;
5+ import org .spongepowered .asm .mixin .injection .At ;
6+ import org .spongepowered .asm .mixin .injection .Inject ;
7+ import org .spongepowered .asm .mixin .injection .callback .CallbackInfo ;
8+ import wearblackallday .dimthread .util .ThreadPool ;
9+
10+ @ Mixin (MinecraftDedicatedServer .class )
11+ public abstract class MinecraftDedicatedServerMixin extends MinecraftServerMixin {
12+ @ Inject (method = "exit" , at = @ At ("HEAD" ))
13+ private void onExit (CallbackInfo ci ) {
14+ ThreadPool pool = getDimThreadPool ();
15+ if (pool != null )
16+ pool .shutdown ();
17+ }
18+ }
Original file line number Diff line number Diff line change @@ -128,7 +128,8 @@ public void restart() {
128128 }
129129
130130 public void shutdown () {
131- this .executor .shutdown ();
131+ if (!isShutdown ())
132+ this .executor .shutdown ();
132133 }
133134
134135 public boolean isShutdown () {
Original file line number Diff line number Diff line change 55 "compatibilityLevel" : " JAVA_17" ,
66 "mixins" : [
77 " EntityMixin" ,
8+ " MinecraftDedicatedServerMixin" ,
89 " MinecraftServerMixin" ,
910 " RedstoneWireBlockMixin" ,
1011 " ServerChunkManagerMixin" ,
You can’t perform that action at this time.
0 commit comments