-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/gliby-thread-stop' into dev
- Loading branch information
Showing
6 changed files
with
72 additions
and
12 deletions.
There are no files selected for viewing
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
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
21 changes: 21 additions & 0 deletions
21
src/main/java/com/mitchej123/hodgepodge/mixins/late/glibysvoicechat/MixinClientNetwork.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,21 @@ | ||
package com.mitchej123.hodgepodge.mixins.late.glibysvoicechat; | ||
|
||
import net.gliby.voicechat.client.networking.ClientNetwork; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Mixin(ClientNetwork.class) | ||
public class MixinClientNetwork { | ||
|
||
@Redirect( | ||
method = "stopClientNetwork", | ||
at = @At(value = "INVOKE", target = "Ljava/lang/Thread;stop()V"), | ||
remap = false) | ||
void hodgepodge$stopClientThread(Thread instance) { | ||
// A manual shutdown signal was already sent earlier, and Thread.stop crashes on newer Java versions | ||
// Force into daemon mode to allow a clean shutdown to happen. | ||
instance.setDaemon(true); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...main/java/com/mitchej123/hodgepodge/mixins/late/glibysvoicechat/MixinVoiceChatServer.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,18 @@ | ||
package com.mitchej123.hodgepodge.mixins.late.glibysvoicechat; | ||
|
||
import net.gliby.voicechat.common.VoiceChatServer; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Mixin(VoiceChatServer.class) | ||
public class MixinVoiceChatServer { | ||
|
||
@Redirect(method = "stop", at = @At(value = "INVOKE", target = "Ljava/lang/Thread;stop()V"), remap = false) | ||
void hodgepodge$stopServerThread(Thread instance) { | ||
// A manual shutdown signal was already sent earlier, and Thread.stop crashes on newer Java versions | ||
// Force into daemon mode to allow a clean shutdown to happen. | ||
instance.setDaemon(true); | ||
} | ||
} |