From 4b761abcb2d96e84e9362d290f805a0508cec51b Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Tue, 27 Oct 2026 01:56:41 +0100 Subject: [PATCH] Launcher: play straight into a world or server, and the Multiplayer list Each world on Home gets Play (the game starts with --world ), and Home lists the selected instance's servers from the game's own servers.dat: Join starts the game with --server
, Add server and Remove change the file. server_list reads and writes it as vanilla's ServerList does (uncompressed NBT, a new file then servers.dat_old) and writes every entry back with all its fields, the hidden Direct Connection ones too. CLI: `multiplayer [list|add|remove] [--instance]`, `play --server`; MCP: play takes `server`; `multiplayer remove` needs confirm. Co-Authored-By: Claude Opus 5.5 --- docs/launcher-commands.md | 34 ++++ launcher/Cargo.lock | 1 + launcher/Cargo.toml | 1 + launcher/README.md | 9 ++ launcher/src/cli.rs | 93 +++++++++++ launcher/src/cli_tools.rs | 1 + launcher/src/lib.rs | 1 + launcher/src/main.rs | 23 +++ launcher/src/mcp.rs | 7 + launcher/src/multiplayer_page.rs | 251 ++++++++++++++++++++++++++++++ launcher/src/server_list.rs | 159 +++++++++++++++++++ launcher/src/server_list/tests.rs | 143 +++++++++++++++++ launcher/src/servers_page.rs | 8 +- launcher/src/worlds_page.rs | 15 +- 14 files changed, 744 insertions(+), 2 deletions(-) create mode 100644 launcher/src/multiplayer_page.rs create mode 100644 launcher/src/server_list.rs create mode 100644 launcher/src/server_list/tests.rs diff --git a/docs/launcher-commands.md b/docs/launcher-commands.md index 5d46c10cd..66062de97 100644 --- a/docs/launcher-commands.md +++ b/docs/launcher-commands.md @@ -54,6 +54,7 @@ Start the client. - `--world`: Open or create this world (a folder under saves) at once - `--creative`: Creative mode for a new world - `--join`: Join a friend's world with its invite code +- `--server`: Join this server at once: an address, or a server of the list by name or position - `--arg`: An extra argument for the game, passed through as-is (repeatable), for example --server-thread MCP: `play`, then the `game_*` tools. @@ -373,6 +374,39 @@ Move a world to the system's trash. MCP: `worlds_delete`, needs `confirm: true`. +## `horizon-launcher multiplayer list` + +The servers of the game's Multiplayer screen (the default). + + horizon-launcher multiplayer list + +- `--instance`: The instance (default: the selected one) + +MCP: `multiplayer_list`. + +## `horizon-launcher multiplayer add` + +Add a server to the list. + + horizon-launcher multiplayer add
+ +- `ADDRESS`: Its address, as in the game's Add Server (host or host:port) +- `--name`: Its name in the list (default: Minecraft Server) +- `--instance` + +MCP: `multiplayer_add`. + +## `horizon-launcher multiplayer remove` + +Remove a server from the list: its position from 1, name or address. + + horizon-launcher multiplayer remove + +- `SERVER` +- `--instance` + +MCP: `multiplayer_remove`, needs `confirm: true`. + ## `horizon-launcher modpack list` The imported packs and their coverage (the default). diff --git a/launcher/Cargo.lock b/launcher/Cargo.lock index dbd21a37f..bace865b6 100644 --- a/launcher/Cargo.lock +++ b/launcher/Cargo.lock @@ -2734,6 +2734,7 @@ dependencies = [ name = "horizon-launcher" version = "0.2.0" dependencies = [ + "base64", "chrono", "clap", "dirs 5.0.1", diff --git a/launcher/Cargo.toml b/launcher/Cargo.toml index 57179380b..979a781d2 100644 --- a/launcher/Cargo.toml +++ b/launcher/Cargo.toml @@ -42,6 +42,7 @@ horizon-world = { path = "../crates/horizon-world" } # Deleting a world moves it to the system's trash trash = "5" # Backup names carry the local time, as vanilla's do +base64 = "0.22" chrono = { version = "0.4", default-features = false, features = ["clock"] } # The session file's random name. getrandom = "0.3" diff --git a/launcher/README.md b/launcher/README.md index 6a8fe7086..34b7c2317 100644 --- a/launcher/README.md +++ b/launcher/README.md @@ -86,6 +86,13 @@ The opening, then Play ([clip](docs/opening.webm)): (`_