Skip to content

Commit

Permalink
Fix deadlock when joining friend's world from singleplayer
Browse files Browse the repository at this point in the history
Fixes #77
  • Loading branch information
Gaming32 committed May 30, 2024
1 parent bf96acf commit f9c6a5c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/io/github/gaming32/worldhost/WorldHost.java
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,9 @@ public static void connect(Screen parentScreen, long cid) {

public static void connect(Screen parentScreen, long cid, String host, int port) {
final Minecraft minecraft = Minecraft.getInstance();
if (minecraft.getSingleplayerServer() != null) {
minecraft.getSingleplayerServer().halt(false);
}
final ServerAddress serverAddress = new ServerAddress(host, port);
ConnectScreen.startConnecting(
parentScreen, minecraft, serverAddress,
Expand Down

0 comments on commit f9c6a5c

Please sign in to comment.