-
-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix exit on main thread deadlock (#1256)
- Loading branch information
Showing
3 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
.../main/java/io/izzel/arclight/common/mixin/core/server/Main_ServerShutdownThreadMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.izzel.arclight.common.mixin.core.server; | ||
|
||
import net.minecraft.server.MinecraftServer; | ||
import org.spigotmc.AsyncCatcher; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Mixin(targets = "net/minecraft/server/Main$1") | ||
public class Main_ServerShutdownThreadMixin { | ||
|
||
@Redirect(method = "run", at = @At(value = "INVOKE", remap = true, target = "Lnet/minecraft/server/MinecraftServer;halt(Z)V")) | ||
private void arclight$shutdown(MinecraftServer instance, boolean b) { | ||
AsyncCatcher.enabled = false; | ||
instance.close(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters