Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,18 @@ public static Optional<Coordinate> get() {
));
// LAN server
} else if (serverData.isLan()) {
String motd = serverData.motd.getString();
// LAN-FIX VERSION: motd can be null sometimes, fallback to server name or empty string
String motd = serverData.motd != null ? serverData.motd.getString() :
(serverData.name != null ? serverData.name : "LAN");
// Extract world name from MOTD format "PlayerName - WorldName"
// Use singleplayer prefix so LAN guests share the same Memory Bank as host
String worldName = motd;
int separatorIndex = motd.indexOf(" - ");
if (separatorIndex != -1 && separatorIndex + 3 < motd.length()) {
worldName = motd.substring(separatorIndex + 3);
}
return Optional.of(new Coordinate.Lan(
"lan/" + Sanitizer.sanitize(motd),
"singleplayer/" + Sanitizer.sanitize(worldName),
"LAN: " + motd
));
// Multiplayer
Expand Down