Skip to content

Commit fc47c40

Browse files
committed
Fix Offline mode with LAN servers
1 parent 1b6826e commit fc47c40

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/org/mcphackers/launchwrapper/LaunchConfig.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import java.util.LinkedHashMap;
1010
import java.util.List;
1111
import java.util.Map;
12+
import java.util.UUID;
1213
import java.util.regex.Pattern;
1314

1415
import org.mcphackers.launchwrapper.protocol.skin.MojangSkinProvider;
@@ -184,6 +185,10 @@ public LaunchConfig(String[] args) {
184185
// Resolve profile UUID if we only provide username
185186
uuid.set(MojangSkinProvider.getUUIDfromName(username.get()));
186187
}
188+
if (uuid.get() == null) {
189+
// If uuid is still null, generate random one (Fixes LAN play when there is no internet connection)
190+
uuid.set(UUID.randomUUID().toString().replace("-", ""));
191+
}
187192
if (accessToken.get() == null && session.get() != null && session.get().startsWith("token:")) {
188193
// Parse the session ID for the access token if we don't have it
189194
// 'token:<ACCESS_TOKEN>:<UUID>'

0 commit comments

Comments
 (0)