-
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.
Fix Gliby's Voice Chat crashing on modern Java (#386)
* Use rfg.deobf directly in dependencies * Fix Gliby's Voice Chat crashing on modern Java Removes Thread.stop usage from GVC, as that method has been deprecated and then made to crash in newer Java versions. The mod was already doing a clean shutdown of the threads, there's no need to also force-kill them. --------- Co-authored-by: ah-OOG-ah <75745146+ah-OOG-ah@users.noreply.github.com> Co-authored-by: Martin Robertz <dream-master@gmx.net>
- Loading branch information
1 parent
6bad750
commit 31126c3
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); | ||
} | ||
} |