From de808e36129670562bdc55ecc0fe56108b4dedce Mon Sep 17 00:00:00 2001 From: Kacpherek Date: Mon, 26 Oct 2026 19:51:31 +0100 Subject: [PATCH 01/11] Empty a bundle by holding right click --- crates/horizon-client/src/bundle.rs | 4 +- crates/horizon-client/src/game.rs | 59 ++++++++++++++++++++++++ crates/horizon-client/src/game/remote.rs | 11 +++++ 3 files changed, 73 insertions(+), 1 deletion(-) diff --git a/crates/horizon-client/src/bundle.rs b/crates/horizon-client/src/bundle.rs index 42473729f..6842d2584 100644 --- a/crates/horizon-client/src/bundle.rs +++ b/crates/horizon-client/src/bundle.rs @@ -49,10 +49,12 @@ impl Weight { /// The sounds of `BundleItem` (`Entity.playSound` at the player): insert /// and remove one at volume 0.8 and pitch `0.8 + random * 0.4`, a failed -/// insert at 1, 1. +/// insert at 1, 1; the drop of its contents is played at the player's block +/// like remove one. pub const INSERT: &str = "minecraft:item.bundle.insert"; pub const INSERT_FAIL: &str = "minecraft:item.bundle.insert_fail"; pub const REMOVE_ONE: &str = "minecraft:item.bundle.remove_one"; +pub const DROP_CONTENTS: &str = "minecraft:item.bundle.drop_contents"; fn max_stack(items: &Items, stack: &ItemStack) -> u32 { items.get(&stack.item).map_or(64, |i| i.max_stack).max(1) diff --git a/crates/horizon-client/src/game.rs b/crates/horizon-client/src/game.rs index cca1f1ee6..5e3b6864c 100644 --- a/crates/horizon-client/src/game.rs +++ b/crates/horizon-client/src/game.rs @@ -3741,6 +3741,14 @@ impl Game<'_> { self.use_spyglass(); return Ok(true); } + // BundleItem.use: startUsingItem, then onUseTick empties it. + if !on_block && info.bundle { + if self.using.is_none() { + self.using = Some((self.held_slot(), 0)); + } + self.swing_arm(); + return Ok(true); + } if !on_block && &*stack.item == "minecraft:bow" { if self.using.is_none() && (self.creative || self.projectile_slot("minecraft:bow").is_some()) @@ -4010,6 +4018,10 @@ impl Game<'_> { } return; } + if info.bundle { + self.tick_bundle(slot, ticks); + return; + } let Some(consumable) = info.consumable.as_ref() else { self.using = None; return; @@ -4031,6 +4043,53 @@ impl Game<'_> { self.using = Some((slot, ticks)); } } + /// `BundleItem.onUseTick` and `getUseDuration` (200): the first tick and + /// then every second tick from the 11th on drop one stack out of the + /// bundle in `slot`; the use ends after 200 ticks. + fn tick_bundle(&mut self, slot: usize, ticks: u32) { + const USE_DURATION: u32 = 200; + let remaining = USE_DURATION - ticks.min(USE_DURATION); + if ticks == 0 || (remaining < USE_DURATION - 10 && remaining.is_multiple_of(2)) { + self.drop_bundle_content(slot); + } + self.using = (ticks + 1 < USE_DURATION).then_some((slot, ticks + 1)); + } + /// `BundleItem.dropContent`: `removeOneItemFromBundle` and `Player.drop`, + /// then the drop sound and the used statistic. + fn drop_bundle_content(&mut self, slot: usize) { + let items = self.res.items(); + let Some(mut bundle) = self.stack_in(slot).cloned() else { + return; + }; + let Some(mut contents) = horizon_client::bundle::Contents::of(items, &bundle) else { + return; + }; + let Some(removed) = contents.remove_one(items) else { + return; + }; + contents.store(&mut bundle); + let item = Arc::clone(&bundle.item); + *self.stack_in_mut(slot) = Some(bundle); + let Some(position) = self.player.as_ref().map(|p| p.position) else { + return; + }; + let at = [position.x, position.y, position.z]; + // playRemoveOneSound, then Player.drop and playDropContentsSound at + // the player's block. + let pitch = 0.8 + self.world.random.next_float() * 0.4; + self.audio + .play(horizon_client::bundle::REMOVE_ONE, Some(at), 0.8, pitch); + self.player_drop(removed); + let block = BlockPos::containing(position); + let pitch = 0.8 + self.world.random.next_float() * 0.4; + self.audio.play( + horizon_client::bundle::DROP_CONTENTS, + Some([block.x, block.y, block.z].map(|v| f64::from(v) + 0.5)), + 0.8, + pitch, + ); + self.stats.add("used", &item, 1); + } /// `LivingEntity.releaseUsingItem` (`Item.releaseUsing`) for `stack`, /// used for `ticks`, its hand acting: a bow or a trident lets go (not /// when its hand changed), a spyglass stops scoping. diff --git a/crates/horizon-client/src/game/remote.rs b/crates/horizon-client/src/game/remote.rs index 3cfbd15e3..54c4aa5df 100644 --- a/crates/horizon-client/src/game/remote.rs +++ b/crates/horizon-client/src/game/remote.rs @@ -4318,7 +4318,10 @@ impl Game<'_> { if self.using.is_some() { return; } + let bundle = self.res.items().get(&held.item).is_some_and(|i| i.bundle); let start = match &*held.item { + // BundleItem.use: always starts; the server drops the contents. + _ if bundle => true, // BowItem.use: with an arrow, or in creative. "minecraft:bow" => self.creative || self.projectile_slot("minecraft:bow").is_some(), // CrossbowItem.use: charging when not charged and with ammunition; @@ -4383,6 +4386,14 @@ impl Game<'_> { // Another hotbar slot picked: LivingEntity.updatingUsingItem sees a // different stack in the hand. The off hand keeps its item. let in_hand = slot == self.selected || slot == super::shield::OFFHAND_SLOT; + // BundleItem.getUseDuration: 200 ticks, the server drops the contents. + if stack + .as_ref() + .is_some_and(|s| self.res.items().get(&s.item).is_some_and(|i| i.bundle)) + { + self.using = (in_hand && ticks + 1 < 200).then_some((slot, ticks + 1)); + return; + } // A drawn bow, a charging crossbow, a raised shield...: held until // the button lets go. if stack.as_ref().is_some_and(|s| self.held_until_released(s)) { From 6145077d7e094b19a0940fbf94bd13de10a03a37 Mon Sep 17 00:00:00 2001 From: Kacpherek Date: Mon, 26 Oct 2026 21:44:11 +0100 Subject: [PATCH 02/11] Make a tame parrot answer only to its owner --- crates/horizon-client/src/game/creatures.rs | 10 ++++++++-- crates/horizon-client/src/game/lan_mobs.rs | 15 ++++++++++++++- crates/horizon-client/src/mobs/tame.rs | 6 +++++- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/crates/horizon-client/src/game/creatures.rs b/crates/horizon-client/src/game/creatures.rs index 8eb4cc911..1b9a31679 100644 --- a/crates/horizon-client/src/game/creatures.rs +++ b/crates/horizon-client/src/game/creatures.rs @@ -2565,6 +2565,7 @@ impl Game<'_> { .item_tags .get("minecraft:parrot_poisonous_food") .is_some_and(|t| t.contains(&*item)); + let acting = self.acting_uuid(); let m = &mut self.mobs[index]; if !m.alive() { return Ok(false); @@ -2772,7 +2773,12 @@ impl Game<'_> { } // Parrot.mobInteract: the owner makes a tame parrot on the ground // sit or stand (poisonous food is handled apart). - Species::Parrot if m.extra.tame && m.on_ground && !parrot_poisonous => { + Species::Parrot + if m.extra.tame + && m.extra.owner == Some(acting) + && m.on_ground + && !parrot_poisonous => + { m.extra.sitting = !m.extra.sitting; self.world.modified.insert(( m.position.x.floor() as i32 >> 4, @@ -2841,7 +2847,7 @@ impl Game<'_> { let tamed = m.random.next_int_bound(10).unwrap_or(1) == 0; if tamed { m.extra.tame = true; - m.extra.owner = self.level.player_uuid.or(Some([0, 0, 0, 1])); + m.extra.owner = Some(acting); } let kind = if tamed { "heart" } else { "smoke" }; // TamableAnimal.spawnTamingParticles (entity event 7 or 6). diff --git a/crates/horizon-client/src/game/lan_mobs.rs b/crates/horizon-client/src/game/lan_mobs.rs index 4f53cec60..39bbd9794 100644 --- a/crates/horizon-client/src/game/lan_mobs.rs +++ b/crates/horizon-client/src/game/lan_mobs.rs @@ -5,7 +5,7 @@ //! (hits, pushes, fire, its projectiles) runs with that guest swapped in. use super::{Game, lan::LanHost}; use horizon_client::{ - mobs::{Mob, MobEvent, PlayerView, Who}, + mobs::{Mob, MobEvent, PlayerView, Species, Who}, projectiles::{Hit, Projectile}, }; use horizon_core::geometry::{Aabb, Vec3}; @@ -26,6 +26,19 @@ pub(super) fn player_for( guests: &GuestViews, bound: Option, ) -> Option { + // A tame parrot sees its owner (`TamableAnimal.getOwner`), while they + // are in play, whoever is nearer. + if m.species() == Species::Parrot + && m.extra.tame + && let Some(owner) = m.extra.owner + { + if host.is_some_and(|v| v.alive && v.uuid == owner) { + return None; + } + if let Some((conn, _)) = guests.iter().find(|(_, v)| v.alive && v.uuid == owner) { + return Some(*conn); + } + } let targeting = m.ai.target == Some(Who::Player) || m.ai.last_hurt_by == Some(Who::Player) && m.age as i32 - m.ai.last_hurt_by_time <= 100; choose(m.position, targeting, host, guests, bound) diff --git a/crates/horizon-client/src/mobs/tame.rs b/crates/horizon-client/src/mobs/tame.rs index 0043ff9ef..d757db0fe 100644 --- a/crates/horizon-client/src/mobs/tame.rs +++ b/crates/horizon-client/src/mobs/tame.rs @@ -135,12 +135,16 @@ pub fn set_tame(m: &mut Mob, tame: bool) { m.attrs.max_health = 8.0; } } -/// The owner (the local player) when tame. +/// The owner (the local player) when tame. A parrot's owner is the player +/// its saved UUID names (`TamableAnimal.getOwner`), not whoever is nearest. fn owner(m: &Mob, w: &MobWorld) -> Option<(Vec3, f64, bool)> { if !m.extra.tame { return None; } let p = w.player.as_ref()?; + if m.species() == Species::Parrot && m.extra.owner != Some(p.uuid) { + return None; + } Some((p.position, p.eye[1], p.spectator)) } /// `TamableAnimal.unableToMoveToOwner`. From beac63849ce65b81a5a6002e2339d4d4ddbe17d2 Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Tue, 27 Oct 2026 08:42:36 +0100 Subject: [PATCH 03/11] refactor: move the client's input modules into horizon-client-input Key bindings and names, toggle keys, mouse options, controller settings, the clipboard and window options move to their own crate, re-exported under their old paths. Their unit tests now rebuild in about a second after an edit instead of rebuilding the client lib's test binary. Co-Authored-By: Claude Opus 5.5 --- AGENTS.md | 5 ++-- Cargo.lock | 14 ++++++++++- Cargo.toml | 1 + crates/horizon-client-input/Cargo.toml | 23 +++++++++++++++++++ .../src/clipboard.rs | 0 .../src/gamepad.rs | 0 .../src/input.rs | 0 .../src/interaction_input.rs | 0 .../src/key_names.rs | 0 .../src/keybinds.rs | 0 .../src/keymapping.rs | 0 crates/horizon-client-input/src/lib.rs | 14 +++++++++++ .../src/mouse.rs | 0 .../src/window.rs | 0 crates/horizon-client/Cargo.toml | 4 ++-- crates/horizon-client/src/lib.rs | 18 +++++++-------- docs/controllers.md | 2 +- tools/test_frame_limiter_parity.py | 2 +- tools/test_interaction_input_parity.py | 2 +- tools/test_local_input_parity.py | 2 +- tools/test_options_parity.py | 4 ++-- tools/test_sprint_input_parity.py | 2 +- tools/test_toggle_keys_parity.py | 2 +- 23 files changed, 73 insertions(+), 22 deletions(-) create mode 100644 crates/horizon-client-input/Cargo.toml rename crates/{horizon-client => horizon-client-input}/src/clipboard.rs (100%) rename crates/{horizon-client => horizon-client-input}/src/gamepad.rs (100%) rename crates/{horizon-client => horizon-client-input}/src/input.rs (100%) rename crates/{horizon-client => horizon-client-input}/src/interaction_input.rs (100%) rename crates/{horizon-client => horizon-client-input}/src/key_names.rs (100%) rename crates/{horizon-client => horizon-client-input}/src/keybinds.rs (100%) rename crates/{horizon-client => horizon-client-input}/src/keymapping.rs (100%) create mode 100644 crates/horizon-client-input/src/lib.rs rename crates/{horizon-client => horizon-client-input}/src/mouse.rs (100%) rename crates/{horizon-client => horizon-client-input}/src/window.rs (100%) diff --git a/AGENTS.md b/AGENTS.md index 0eb1fe8b5..2f754ed53 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -38,6 +38,7 @@ Game workspace (root `Cargo.toml`); `launcher/` and `crates/horizon-telemetry-se | `horizon-client` | The game: a lib (`src/lib.rs`, ~180 flat modules) and the bin (`src/main.rs` → `game.rs` + `game/`), plus `horizon-ctl` (`src/bin/horizon-ctl/`). Also the dedicated server (`--dedicated`) | | `horizon-command` | Command parsing (Brigadier): the vanilla tree, argument types, selectors, suggestions, the tree's network form. Re-exported as `horizon_client::command` | | `horizon-client-core` | The client lib's bottom layer: `text.rs`, `lang.rs`, `snbt.rs`, `nbt_path.rs`, `component.rs`, `scoreboard.rs`, `bossbar.rs`, `gamerules.rs`, `block_entity_nbt.rs`, registry/particle/sound tables. Re-exported under the old paths (`horizon_client::text`...) | +| `horizon-client-input` | Key bindings and key names, toggle keys, mouse options, controller settings and glyphs, the clipboard, window options (`keybinds.rs`, `gamepad.rs`, `mouse.rs`, `window.rs`...). Re-exported under the old paths | | `horizon-world` | Vanilla world data with no gameplay loop: NBT, regions, chunks, `datafix/`, `worldgen/`, `level/` (server-side block behaviour, ticks, redstone), entity physics, items, effects, food, damage | | `horizon-core` | Simulation primitives: Java `Random`s, `jmath` (HotSpot-exact `Math`), positions, noise, density, paletted storage, `version.rs` (the pinned version) | | `horizon-protocol` | Network protocol 777: codecs, framing, encryption, `packets/{handshake,status,login,configuration,play}.rs`, `entity_data.rs` | @@ -112,7 +113,7 @@ python3 tools/agent_control_e2e.py # horizon-ctl / MCP end to end | Subsystem | Files | |---|---| -| Game loop, tick, frame | `game.rs`: `fn run`, `impl ApplicationHandler for Game` (`window_event`, `about_to_wait`), `fn tick`, `fn tick_world`, `fn render`; L: `clock.rs`, `window.rs`, `spans.rs` | +| Game loop, tick, frame | `game.rs`: `fn run`, `impl ApplicationHandler for Game` (`window_event`, `about_to_wait`), `fn tick`, `fn tick_world`, `fn render`; L: `clock.rs`, `spans.rs`; `horizon-client-input/src/window.rs` | | Rendering | L: `gfx.rs` (`Renderer::new`, `Renderer::render`), `gfx/` (cull, occlusion, translucency, upload, timing, lod, weather, stars, end_sky), `*.wgsl`, `particles.rs`, `block_entity_render.rs`, `item_render.rs`, `fog.rs`, `clouds.rs`, `camera.rs`, `first_person.rs`; G: `render_tick.rs`, `item_draw.rs` | | Chunks, streaming, light | L: `streaming.rs` (worker pool: generate, light, mesh), `world.rs`, `chunk.rs`, `chunk_map.rs`, `light.rs`, `mesher.rs` + `mesher/`, `vanillagen.rs` (binds horizon-world's generator), `lod.rs` + `lod/`, `ticket_levels.rs`; G: `world_loading.rs`, `postprocess.rs`; game.rs `fn update_world` | | World generation | `crates/horizon-world/src/worldgen/` (`generator*.rs`, `feature_graph.rs`, `structure/`, `carver/`) | @@ -128,7 +129,7 @@ python3 tools/agent_control_e2e.py # horizon-ctl / MCP end to end | Integrated server | G: `integrated.rs` (the server thread), `levels.rs` (one level per dimension, `fn tick_server`), `server_travel.rs` | | Dedicated server | G: `dedicated.rs`, `dedicated/status.rs`; crates `horizon-server-files`, `horizon-server` | | Save and load | L: `save.rs` (level.dat, regions, playerdata), `entity_nbt.rs`, `options_file.rs`; `horizon-client-core/src/block_entity_nbt.rs`; G: `saving.rs`, `persist.rs` (entities); `crates/horizon-world/src/{region.rs,nbt.rs,datafix/}` | -| Input | game.rs `fn window_event`, `fn key_pressed`, `fn play_mouse`; L: `keybinds.rs`, `keymapping.rs`, `key_names.rs`, `mouse.rs`, `input.rs`, `interaction_input.rs`, `gamepad.rs`, `osk.rs`, `clipboard.rs`; G: `pad.rs`, `pad_menu.rs` | +| Input | game.rs `fn window_event`, `fn key_pressed`, `fn play_mouse`; crate `horizon-client-input` (`keybinds.rs`, `keymapping.rs`, `key_names.rs`, `mouse.rs`, `input.rs`, `interaction_input.rs`, `gamepad.rs`, `clipboard.rs`); L: `osk.rs`; G: `pad.rs`, `pad_menu.rs` | | Audio | L: `audio.rs` (mixer), `sound_engine.rs`, `sound_events.rs`, `music.rs`, `ambience.rs`; G: `music.rs`, `subtitle_hud.rs` | | Resource packs | L: `packs.rs` + `packs/`, `pack_screen.rs`, `atlas_sources.rs`, `sprites.rs`, `mipmap.rs`, `model_library.rs`, `font.rs`; `horizon-client-core/src/lang.rs`; crate `horizon-assets`; G: `packs.rs` | | Agent control | L: `control.rs` (socket), `bin/horizon-ctl/`; G: `control.rs`, `agent.rs`, `events.rs`, `ui_control.rs` ([docs/agent-control.md](docs/agent-control.md)) | diff --git a/Cargo.lock b/Cargo.lock index 0e0a39038..2af972983 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1363,7 +1363,6 @@ name = "horizon-client" version = "0.1.0" dependencies = [ "ab_glyph", - "arboard", "bytemuck", "chrono", "cpal", @@ -1373,6 +1372,7 @@ dependencies = [ "horizon-assets", "horizon-bench", "horizon-client-core", + "horizon-client-input", "horizon-command", "horizon-core", "horizon-dualsense", @@ -1413,6 +1413,18 @@ dependencies = [ "serde_json", ] +[[package]] +name = "horizon-client-input" +version = "0.1.0" +dependencies = [ + "arboard", + "horizon-client-core", + "horizon-dualsense", + "horizon-theme", + "png", + "winit", +] + [[package]] name = "horizon-command" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 933901dce..967ce08e8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,7 @@ members = [ "crates/horizon-world", "crates/horizon-client", "crates/horizon-client-core", + "crates/horizon-client-input", "crates/horizon-command", "crates/horizon-server-files", "crates/horizon-server", diff --git a/crates/horizon-client-input/Cargo.toml b/crates/horizon-client-input/Cargo.toml new file mode 100644 index 000000000..e1d7cf72b --- /dev/null +++ b/crates/horizon-client-input/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "horizon-client-input" +version = "0.1.0" +edition.workspace = true +license.workspace = true +rust-version = "1.90" +description = "The client's input layer: key bindings and their names, mouse, controllers, clipboard and window options" + +[dependencies] +horizon-client-core = { path = "../horizon-client-core" } +winit = "0.30.13" +# The window icon. +horizon-theme = { path = "../horizon-theme" } +png = "0.18" +arboard = { version = "3.6.1", default-features = false, features = ["wayland-data-control"] } +# The DualSense's trigger effects (the `controllers` feature). +horizon-dualsense = { path = "../horizon-dualsense", optional = true } + +[features] +controllers = ["dep:horizon-dualsense"] + +[lints] +workspace = true diff --git a/crates/horizon-client/src/clipboard.rs b/crates/horizon-client-input/src/clipboard.rs similarity index 100% rename from crates/horizon-client/src/clipboard.rs rename to crates/horizon-client-input/src/clipboard.rs diff --git a/crates/horizon-client/src/gamepad.rs b/crates/horizon-client-input/src/gamepad.rs similarity index 100% rename from crates/horizon-client/src/gamepad.rs rename to crates/horizon-client-input/src/gamepad.rs diff --git a/crates/horizon-client/src/input.rs b/crates/horizon-client-input/src/input.rs similarity index 100% rename from crates/horizon-client/src/input.rs rename to crates/horizon-client-input/src/input.rs diff --git a/crates/horizon-client/src/interaction_input.rs b/crates/horizon-client-input/src/interaction_input.rs similarity index 100% rename from crates/horizon-client/src/interaction_input.rs rename to crates/horizon-client-input/src/interaction_input.rs diff --git a/crates/horizon-client/src/key_names.rs b/crates/horizon-client-input/src/key_names.rs similarity index 100% rename from crates/horizon-client/src/key_names.rs rename to crates/horizon-client-input/src/key_names.rs diff --git a/crates/horizon-client/src/keybinds.rs b/crates/horizon-client-input/src/keybinds.rs similarity index 100% rename from crates/horizon-client/src/keybinds.rs rename to crates/horizon-client-input/src/keybinds.rs diff --git a/crates/horizon-client/src/keymapping.rs b/crates/horizon-client-input/src/keymapping.rs similarity index 100% rename from crates/horizon-client/src/keymapping.rs rename to crates/horizon-client-input/src/keymapping.rs diff --git a/crates/horizon-client-input/src/lib.rs b/crates/horizon-client-input/src/lib.rs new file mode 100644 index 000000000..53d8f889a --- /dev/null +++ b/crates/horizon-client-input/src/lib.rs @@ -0,0 +1,14 @@ +//! The client's input layer, below gameplay and screens: key bindings and their +//! names, toggle keys, mouse settings, controllers, the clipboard and window +//! options. horizon-client re-exports each module under its old path +//! (`horizon_client::keybinds`, ...). +#![forbid(unsafe_code)] +pub mod clipboard; +pub mod gamepad; +pub mod input; +pub mod interaction_input; +pub mod key_names; +pub mod keybinds; +pub mod keymapping; +pub mod mouse; +pub mod window; diff --git a/crates/horizon-client/src/mouse.rs b/crates/horizon-client-input/src/mouse.rs similarity index 100% rename from crates/horizon-client/src/mouse.rs rename to crates/horizon-client-input/src/mouse.rs diff --git a/crates/horizon-client/src/window.rs b/crates/horizon-client-input/src/window.rs similarity index 100% rename from crates/horizon-client/src/window.rs rename to crates/horizon-client-input/src/window.rs diff --git a/crates/horizon-client/Cargo.toml b/crates/horizon-client/Cargo.toml index 5611edbc9..a3a047176 100644 --- a/crates/horizon-client/Cargo.toml +++ b/crates/horizon-client/Cargo.toml @@ -10,6 +10,7 @@ description = "Horizon native development client" [dependencies] horizon-assets = { path = "../horizon-assets" } horizon-client-core = { path = "../horizon-client-core" } +horizon-client-input = { path = "../horizon-client-input" } horizon-command = { path = "../horizon-command" } horizon-core = { path = "../horizon-core" } # The server thread ahead of the workers (MinecraftServer.spin's Thread.setPriority). @@ -54,7 +55,6 @@ horizon-theme = { path = "../horizon-theme" } # the anonymous "I'm playing" ping the game sends itself (`heartbeat.rs`). horizon-telemetry = { path = "../horizon-telemetry", default-features = false, features = ["live"] } horizon-bench = { path = "../horizon-bench" } -arboard = { version = "3.6.1", default-features = false, features = ["wayland-data-control"] } zip = { version = "2", default-features = false, features = ["deflate"] } # Controllers (evdev + libudev on Linux, IOKit on macOS, Windows.Gaming.Input); the `controllers` feature. gilrs = { version = "0.11", optional = true } @@ -88,7 +88,7 @@ default = ["audio", "controllers"] # Linux: the server build (`--no-default-features`, released as horizon-engine; docs/server.md). audio = ["dep:cpal"] # Controllers: gilrs, and the DualSense's own output. Without it only `horizon-ctl pad`'s virtual pad. -controllers = ["dep:gilrs", "dep:horizon-dualsense"] +controllers = ["dep:gilrs", "dep:horizon-dualsense", "horizon-client-input/controllers"] # Runs code mods (wasmtime and cranelift: a quarter of a clean build). On in every release build # (release.yml); the tests and probes don't need it. Content mods load without it. mods = ["horizon-mods/runtime"] diff --git a/crates/horizon-client/src/lib.rs b/crates/horizon-client/src/lib.rs index fa5ef1c4d..f2ce492f5 100644 --- a/crates/horizon-client/src/lib.rs +++ b/crates/horizon-client/src/lib.rs @@ -32,7 +32,6 @@ pub mod cauldron; pub mod chat; pub mod chunk; pub mod chunk_map; -pub mod clipboard; pub mod clock; pub mod clouds; pub mod collisions; @@ -74,7 +73,6 @@ pub mod fog; pub mod font; pub mod friends_screen; pub mod game_mode_switcher; -pub mod gamepad; pub mod gfx; pub mod gizmos; pub mod gossip; @@ -88,8 +86,6 @@ pub mod hud; pub mod hud_layout; pub mod hud_overlays; pub mod hunger; -pub mod input; -pub mod interaction_input; pub mod inv_sort; pub mod inventory_effects; pub mod item_data; @@ -98,9 +94,6 @@ pub mod item_sync; pub mod item_tooltip; pub mod items; pub mod java_text; -pub mod key_names; -pub mod keybinds; -pub mod keymapping; pub mod lan; pub mod landing; pub mod level_loading; @@ -120,7 +113,6 @@ pub mod mod_list; mod model_library; pub mod models; pub mod motion; -pub mod mouse; pub mod moved_extras; pub mod multiplayer; pub mod music; @@ -190,7 +182,6 @@ pub mod vault; pub mod weather; pub mod widgets; pub mod win_screen; -pub mod window; pub mod world; pub mod world_spawn; pub mod worldborder; @@ -206,4 +197,13 @@ pub use horizon_client_core::nbt_path; pub use horizon_client_core::scoreboard; pub use horizon_client_core::snbt; pub use horizon_client_core::text; +pub use horizon_client_input::clipboard; +pub use horizon_client_input::gamepad; +pub use horizon_client_input::input; +pub use horizon_client_input::interaction_input; +pub use horizon_client_input::key_names; +pub use horizon_client_input::keybinds; +pub use horizon_client_input::keymapping; +pub use horizon_client_input::mouse; +pub use horizon_client_input::window; pub use horizon_command as command; diff --git a/docs/controllers.md b/docs/controllers.md index c2ac6b5d3..b94e07b9c 100644 --- a/docs/controllers.md +++ b/docs/controllers.md @@ -25,7 +25,7 @@ Select/Start). No second windowing or event stack: gilrs is polled once per loop iteration next to winit's events. - The pure logic (mapping table, deadzones and curves, button edges, the - settings file, glyph choice) lives in `crates/horizon-client/src/gamepad.rs` + settings file, glyph choice) lives in `crates/horizon-client-input/src/gamepad.rs` and is unit-tested. The game owns a thin gilrs backend and applies actions. - Controller actions go through the same path a keyboard key takes after rebinding: an action names a vanilla key mapping (`key.jump`, `key.attack`, diff --git a/tools/test_frame_limiter_parity.py b/tools/test_frame_limiter_parity.py index 1ff2099be..1e1fdfd75 100644 --- a/tools/test_frame_limiter_parity.py +++ b/tools/test_frame_limiter_parity.py @@ -62,7 +62,7 @@ def main(): 'real OS sleep accuracy is outside the comparison.') harness.differential( 'rust-frame-limiter-parity', 'VanillaFrameLimiterOracle', 'frame_limiter_probe', make_cases, scope, - sources=[lab.ROOT / 'crates/horizon-client/src/window.rs']) + sources=[lab.ROOT / 'crates/horizon-client-input/src/window.rs']) if __name__ == '__main__': diff --git a/tools/test_interaction_input_parity.py b/tools/test_interaction_input_parity.py index 1aa34a73f..1944a2ac7 100644 --- a/tools/test_interaction_input_parity.py +++ b/tools/test_interaction_input_parity.py @@ -43,7 +43,7 @@ def main(): "Includes passing entity interactions over solid blocks: only the held " "item may be tried afterward. " "Game-mode side effects and world simulation are controlled fixtures.", - sources=[lab.ROOT / "crates/horizon-client/src/interaction_input.rs", + sources=[lab.ROOT / "crates/horizon-client-input/src/interaction_input.rs", lab.ROOT / "crates/horizon-client/src/game/remote.rs", lab.ROOT / "crates/horizon-client/src/game/hand.rs", lab.ROOT / "mods/horizon/src/test/java/dev/horizonlab/parity/ParityData.java"]) diff --git a/tools/test_local_input_parity.py b/tools/test_local_input_parity.py index c50087138..6d46dcf29 100644 --- a/tools/test_local_input_parity.py +++ b/tools/test_local_input_parity.py @@ -35,7 +35,7 @@ def main(): build=lab.LOCAL/'rust-local-input';build.mkdir(exist_ok=True) report=build/'report.json';report.unlink(missing_ok=True) oracle=lab.ROOT/'mods/horizon/src/test/java/dev/horizonlab/parity/VanillaLocalInputOracle.java' - sources=[Path(__file__),lab.ROOT/'tools/test_rust_parity.py',lab.ROOT/'tools/test_model_baking_parity.py',lab.ROOT/'tools/lab.py',oracle,lab.ROOT/'Cargo.toml',lab.ROOT/'Cargo.lock',lab.ROOT/'crates/horizon-client/Cargo.toml',lab.ROOT/'crates/horizon-client/src/input.rs',lab.ROOT/'crates/horizon-client/src/lib.rs',lab.ROOT/'crates/horizon-client/examples/probe/input_probe.rs'] + sources=[Path(__file__),lab.ROOT/'tools/test_rust_parity.py',lab.ROOT/'tools/test_model_baking_parity.py',lab.ROOT/'tools/lab.py',oracle,lab.ROOT/'Cargo.toml',lab.ROOT/'Cargo.lock',lab.ROOT/'crates/horizon-client/Cargo.toml',lab.ROOT/'crates/horizon-client-input/src/input.rs',lab.ROOT/'crates/horizon-client/src/lib.rs',lab.ROOT/'crates/horizon-client/examples/probe/input_probe.rs'] tested=base.source_hashes(sources) def run(command,name): with (build/(name+'.log')).open('w') as log:subprocess.run(list(map(str,command)),cwd=lab.ROOT,check=True,timeout=600,stdout=log,stderr=subprocess.STDOUT) diff --git a/tools/test_options_parity.py b/tools/test_options_parity.py index e99f67a44..82bc5b9ec 100644 --- a/tools/test_options_parity.py +++ b/tools/test_options_parity.py @@ -189,8 +189,8 @@ def main(): harness.differential( 'rust-options-parity', 'VanillaOptionsOracle', 'options_probe', make_cases, scope, sources=[lab.ROOT / 'crates/horizon-client/src/options_file.rs', lab.ROOT / 'crates/horizon-client/src/options_fixes.rs', - lab.ROOT / 'crates/horizon-client/src/java_text.rs', lab.ROOT / 'crates/horizon-client/src/key_names.rs', - lab.ROOT / 'crates/horizon-client/src/keybinds.rs']) + lab.ROOT / 'crates/horizon-client/src/java_text.rs', lab.ROOT / 'crates/horizon-client-input/src/key_names.rs', + lab.ROOT / 'crates/horizon-client-input/src/keybinds.rs']) if __name__ == '__main__': diff --git a/tools/test_sprint_input_parity.py b/tools/test_sprint_input_parity.py index b2b86b7c2..d89530826 100644 --- a/tools/test_sprint_input_parity.py +++ b/tools/test_sprint_input_parity.py @@ -40,7 +40,7 @@ def main(): build=lab.LOCAL/'rust-sprint-input';build.mkdir(exist_ok=True) report=build/'report.json';report.unlink(missing_ok=True) oracle=lab.ROOT/'mods/horizon/src/test/java/dev/horizonlab/parity/VanillaSprintInputOracle.java' - sources=[Path(__file__),lab.ROOT/'tools/test_rust_parity.py',lab.ROOT/'tools/test_model_baking_parity.py',lab.ROOT/'tools/lab.py',oracle,lab.ROOT/'Cargo.toml',lab.ROOT/'Cargo.lock',lab.ROOT/'crates/horizon-client/Cargo.toml',lab.ROOT/'crates/horizon-client/src/input.rs',lab.ROOT/'crates/horizon-client/src/sprint.rs',lab.ROOT/'crates/horizon-client/src/lib.rs',lab.ROOT/'crates/horizon-client/examples/probe/sprint_probe.rs'] + sources=[Path(__file__),lab.ROOT/'tools/test_rust_parity.py',lab.ROOT/'tools/test_model_baking_parity.py',lab.ROOT/'tools/lab.py',oracle,lab.ROOT/'Cargo.toml',lab.ROOT/'Cargo.lock',lab.ROOT/'crates/horizon-client/Cargo.toml',lab.ROOT/'crates/horizon-client-input/src/input.rs',lab.ROOT/'crates/horizon-client/src/sprint.rs',lab.ROOT/'crates/horizon-client/src/lib.rs',lab.ROOT/'crates/horizon-client/examples/probe/sprint_probe.rs'] tested=base.source_hashes(sources) def run(command,name): with (build/(name+'.log')).open('w') as log:subprocess.run(list(map(str,command)),cwd=lab.ROOT,check=True,timeout=600,stdout=log,stderr=subprocess.STDOUT) diff --git a/tools/test_toggle_keys_parity.py b/tools/test_toggle_keys_parity.py index a5d2b0500..07e9523ff 100644 --- a/tools/test_toggle_keys_parity.py +++ b/tools/test_toggle_keys_parity.py @@ -69,7 +69,7 @@ def main(): 'not exercised; KeyboardInput then reads isDown as the sprint and local input harnesses compare.') harness.differential( 'rust-toggle-keys-parity', 'VanillaToggleKeysOracle', 'toggle_keys_probe', make_cases, scope, - sources=[lab.ROOT / 'crates/horizon-client/src/keymapping.rs']) + sources=[lab.ROOT / 'crates/horizon-client-input/src/keymapping.rs']) if __name__ == '__main__': From 0d554de016241881c62c75078fb5c27e268107e0 Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Tue, 27 Oct 2026 13:48:09 +0100 Subject: [PATCH 04/11] parity: game_loop records mouse, window and keymapping from the input crate The harness hashed crates/horizon-client/src/{mouse,window,keymapping}.rs, which this branch moves to horizon-client-input, so CI's parity job failed with FileNotFoundError before running it. Co-Authored-By: Claude Opus 5.5 --- tools/test_game_loop_parity.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/test_game_loop_parity.py b/tools/test_game_loop_parity.py index f5f5e94a3..6c9224519 100644 --- a/tools/test_game_loop_parity.py +++ b/tools/test_game_loop_parity.py @@ -154,7 +154,8 @@ def main(): 'FramerateLimiter and vsync present-mode selection are covered by Rust unit tests only.') harness.differential( 'rust-game-loop-parity', 'VanillaGameLoopOracle', 'game_loop_probe', make_cases, scope, - sources=[lab.ROOT / f'crates/horizon-client/src/{name}.rs' for name in ('clock', 'mouse', 'window', 'keymapping')]) + sources=[lab.ROOT / 'crates/horizon-client/src/clock.rs'] + + [lab.ROOT / f'crates/horizon-client-input/src/{name}.rs' for name in ('mouse', 'window', 'keymapping')]) if __name__ == '__main__': From 09142298005c5fe45b1d4883dc5809965d3446eb Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Tue, 27 Oct 2026 15:07:40 +0100 Subject: [PATCH 05/11] A parrot saves its owner in main's Variant arm A second parrot arm was unreachable, so the variant was never saved. Co-Authored-By: Claude Opus 5.5 --- crates/horizon-client/src/entity_nbt.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/crates/horizon-client/src/entity_nbt.rs b/crates/horizon-client/src/entity_nbt.rs index f7cc059aa..72b2136fc 100644 --- a/crates/horizon-client/src/entity_nbt.rs +++ b/crates/horizon-client/src/entity_nbt.rs @@ -330,14 +330,6 @@ pub fn mob_to_nbt(m: &Mob, uuid: [i32; 4], raw: Option<&Tag>) -> Tag { map.insert("Sitting".into(), Tag::Byte(i8::from(m.extra.sitting))); map.insert("CollarColor".into(), Tag::Byte(m.extra.color as i8)); } - "minecraft:parrot" => { - if let Some(owner) = m.extra.owner { - map.insert("Owner".into(), Tag::IntArray(owner.to_vec())); - } else { - map.remove(&"Owner".into()); - } - map.insert("Sitting".into(), Tag::Byte(i8::from(m.extra.sitting))); - } "minecraft:wolf" => { if let Some(owner) = m.extra.owner { map.insert("Owner".into(), Tag::IntArray(owner.to_vec())); @@ -511,6 +503,12 @@ pub fn mob_to_nbt(m: &Mob, uuid: [i32; 4], raw: Option<&Tag>) -> Tag { "Variant".into(), Tag::Int(i32::from(m.extra.variant.min(4))), ); + if let Some(owner) = m.extra.owner { + map.insert("Owner".into(), Tag::IntArray(owner.to_vec())); + } else { + map.remove(&"Owner".into()); + } + map.insert("Sitting".into(), Tag::Byte(i8::from(m.extra.sitting))); } "minecraft:salmon" => { let size = SALMON_SIZES[usize::from(m.extra.variant).min(2)]; From 8d2b2982534d6422dedd7257f3dbae0462e400fd Mon Sep 17 00:00:00 2001 From: leifiyoo Date: Tue, 27 Oct 2026 16:53:00 +0100 Subject: [PATCH 06/11] Keep long Microsoft sign-in secrets in several keychain items Credential Manager takes at most 2560 bytes per item. The secrets of a Microsoft sign-in (the refresh token and the Minecraft token) are longer, so saving them failed on Windows with "password encoded as UTF-16 is longer than platform limit of 2560 chars" and the sign-in did not finish. On macOS and Windows a secret is now split over the items ``, `.1`, `.2`... of at most 1000 UTF-8 bytes each (under 2560 bytes of UTF-16). Reads join the pieces, a write removes the leftovers of a longer secret, and sign-out removes all of them. Existing single items keep working. Co-Authored-By: Claude Haiku 5.5 --- docs/microsoft-account.md | 3 +- launcher/src/account.rs | 96 +++++++++++++++++++++++++++++++---- launcher/src/account/tests.rs | 30 +++++++++++ 3 files changed, 117 insertions(+), 12 deletions(-) diff --git a/docs/microsoft-account.md b/docs/microsoft-account.md index 380aa0785..eeb63f56a 100644 --- a/docs/microsoft-account.md +++ b/docs/microsoft-account.md @@ -74,7 +74,8 @@ one is selected. "Sign out" deletes the account's secrets from the keychain. - Secrets (the Microsoft refresh token, the Minecraft access token and its expiry) go to the OS keychain, one item per account: Keychain on macOS, Credential Manager on Windows, the Secret Service (GNOME Keyring, KWallet) on Linux. Service name `dev.playhorizon.launcher`, account = the - Minecraft UUID. + Minecraft UUID. Credential Manager takes at most 2560 bytes per item, which the secrets of a sign-in + exceed: on macOS and Windows a longer secret is split over the items ``, `.1`, `.2`... - `accounts.json` in the launcher's data folder keeps only public data: UUID, name, skin URL, which account is selected. Never a token. - No keychain available (a Linux box without a Secret Service, a locked keychain): sign-in still diff --git a/launcher/src/account.rs b/launcher/src/account.rs index 257055911..313dbb2f8 100644 --- a/launcher/src/account.rs +++ b/launcher/src/account.rs @@ -580,28 +580,102 @@ impl SecretStore for SystemStore { } } -/// Keychain on macOS, Credential Manager on Windows (the keyring crate). +/// Keychain on macOS, Credential Manager on Windows (the keyring crate). Credential Manager takes at +/// most 2560 bytes of UTF-16 per item and a sign-in's secrets are longer, so a secret is kept in +/// pieces: the first under the account's key, the rest under `key.1`, `key.2`... #[cfg(any(target_os = "macos", target_os = "windows"))] pub struct SystemStore; + +/// Bytes of UTF-8 per keychain item: at most twice as many in UTF-16, well under 2560. +#[cfg(any(target_os = "macos", target_os = "windows"))] +const PIECE: usize = 1000; + +#[cfg(any(target_os = "macos", target_os = "windows"))] +fn piece_key(key: &str, n: usize) -> String { + if n == 0 { + key.to_string() + } else { + format!("{key}.{n}") + } +} + +/// `secret` cut into pieces of at most `PIECE` bytes, on character boundaries. +#[cfg(any(target_os = "macos", target_os = "windows"))] +fn split_secret(mut secret: &str) -> Vec<&str> { + let mut pieces = Vec::new(); + while secret.len() > PIECE { + let mut cut = PIECE; + while !secret.is_char_boundary(cut) { + cut -= 1; + } + let (head, tail) = secret.split_at(cut); + pieces.push(head); + secret = tail; + } + pieces.push(secret); + pieces +} + +#[cfg(any(target_os = "macos", target_os = "windows"))] +fn read_item(key: &str) -> Result, String> { + match keyring::Entry::new(SERVICE, key).and_then(|e| e.get_password()) { + Ok(secret) => Ok(Some(secret)), + Err(keyring::Error::NoEntry) => Ok(None), + Err(e) => Err(e.to_string()), + } +} + +#[cfg(any(target_os = "macos", target_os = "windows"))] +fn write_item(key: &str, secret: &str) -> Result<(), String> { + keyring::Entry::new(SERVICE, key) + .and_then(|e| e.set_password(secret)) + .map_err(|e| e.to_string()) +} + +/// Removes one item; false when there was none. +#[cfg(any(target_os = "macos", target_os = "windows"))] +fn remove_item(key: &str) -> Result { + match keyring::Entry::new(SERVICE, key).and_then(|e| e.delete_credential()) { + Ok(()) => Ok(true), + Err(keyring::Error::NoEntry) => Ok(false), + Err(e) => Err(e.to_string()), + } +} + #[cfg(any(target_os = "macos", target_os = "windows"))] impl SecretStore for SystemStore { fn get(&self, key: &str) -> Result, String> { - match keyring::Entry::new(SERVICE, key).and_then(|e| e.get_password()) { - Ok(secret) => Ok(Some(secret)), - Err(keyring::Error::NoEntry) => Ok(None), - Err(e) => Err(e.to_string()), + let Some(mut secret) = read_item(key)? else { + return Ok(None); + }; + for n in 1.. { + match read_item(&piece_key(key, n))? { + Some(piece) => secret.push_str(&piece), + None => break, + } } + Ok(Some(secret)) } fn set(&self, key: &str, secret: &str) -> Result<(), String> { - keyring::Entry::new(SERVICE, key) - .and_then(|e| e.set_password(secret)) - .map_err(|e| e.to_string()) + let pieces = split_secret(secret); + for (n, piece) in pieces.iter().enumerate() { + write_item(&piece_key(key, n), piece)?; + } + // Pieces left over from a longer secret would be read back as part of this one. + for n in pieces.len().. { + if !remove_item(&piece_key(key, n))? { + break; + } + } + Ok(()) } fn delete(&self, key: &str) -> Result<(), String> { - match keyring::Entry::new(SERVICE, key).and_then(|e| e.delete_credential()) { - Ok(()) | Err(keyring::Error::NoEntry) => Ok(()), - Err(e) => Err(e.to_string()), + for n in 0.. { + if !remove_item(&piece_key(key, n))? { + break; + } } + Ok(()) } fn persistent(&self) -> bool { true diff --git a/launcher/src/account/tests.rs b/launcher/src/account/tests.rs index ec3766c7e..6d0152722 100644 --- a/launcher/src/account/tests.rs +++ b/launcher/src/account/tests.rs @@ -372,6 +372,36 @@ fn accounts_keep_secrets_in_the_store_only() { assert!(!store.persistent()); } +/// The OS keychain itself: Credential Manager and the Keychain take one secret per item, and a +/// sign-in's secrets are longer than one item holds. Ignored by default: it writes to the keychain +/// (a test key, removed again). +#[cfg(any(target_os = "macos", target_os = "windows"))] +#[test] +#[ignore = "writes to the OS keychain"] +fn system_keychain_keeps_long_secrets() { + let key = "test-long-secret"; + let secret = format!("{{\"refresh_token\":\"{}\"}}", "r".repeat(3000)); + SystemStore.set(key, &secret).unwrap(); + assert_eq!(SystemStore.get(key).unwrap(), Some(secret.clone())); + SystemStore.delete(key).unwrap(); + assert_eq!(SystemStore.get(key).unwrap(), None); +} + +#[cfg(any(target_os = "macos", target_os = "windows"))] +#[test] +fn long_secrets_split_into_keychain_sized_pieces() { + // Mixed 1-, 2- and 4-byte characters, so the cuts land inside some of them. + let secret = "aé🔑".repeat(300); + let pieces = split_secret(&secret); + assert!(pieces.len() > 1); + assert_eq!(pieces.concat(), secret); + for piece in &pieces { + assert!(piece.len() <= PIECE); + assert!(piece.encode_utf16().count() * 2 <= 2560); + } + assert_eq!(split_secret("short"), vec!["short"]); +} + #[test] fn session_files_are_private_and_complete() { let dir = std::env::temp_dir().join(format!("horizon-launcher-session-{}", std::process::id())); From 7afb41a1285e418a3e3440374f6e0f99796b9713 Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Tue, 27 Oct 2026 18:25:30 +0100 Subject: [PATCH 07/11] launcher: the owner gate's screen, once for offline players and on a refused Play A player without an account that owns Minecraft: Java Edition sees one screen when the launcher opens (once) and whenever Play is refused: why Horizon needs the account, like other launchers, that worlds, offline names and settings stay where they are, and Sign in, which runs the device-code sign-in on the same screen. Not now closes it; Home keeps its Sign in row, which now opens this screen. Co-Authored-By: Claude Opus 5.5 --- docs/microsoft-account.md | 5 ++ launcher/lang/fr.json | 6 +- launcher/lang/ru.json | 6 +- launcher/src/backend.rs | 4 + launcher/src/main.rs | 24 ++++-- launcher/src/owner_page.rs | 157 +++++++++++++++++++++++++++++++++++++ 6 files changed, 194 insertions(+), 8 deletions(-) create mode 100644 launcher/src/owner_page.rs diff --git a/docs/microsoft-account.md b/docs/microsoft-account.md index 314115fb3..9c457f8a0 100644 --- a/docs/microsoft-account.md +++ b/docs/microsoft-account.md @@ -77,6 +77,11 @@ possible; the launcher just doesn't offer it on its own. again for each account, the selected one first, until one owns the game: the token renewal (below) if due, then entitlements and profile. Without an owner the game doesn't start and Play says "Sign in with a Microsoft account that owns Minecraft: Java Edition to play", with Sign in. +- **The window says it once.** A player without an owner (one who played offline until now) sees + the gate's screen once when the launcher opens: why Horizon needs the account ("like other + launchers"), that worlds, offline names and settings stay where they are, and Sign in, which shows + the device code on the same screen. It comes back whenever Play is refused; Not now closes it, + and Home keeps a Sign in row (`launcher/src/owner_page.rs`). - **The answer lives with the tokens.** Each account's keychain item keeps the last answer (`owns`), so no plain file can say yes. With no network (or a sign-in that can't be renewed) the last answer stands: being offline never blocks a player who passed before, and the game starts diff --git a/launcher/lang/fr.json b/launcher/lang/fr.json index f15700ad3..85c8238e8 100644 --- a/launcher/lang/fr.json +++ b/launcher/lang/fr.json @@ -167,5 +167,9 @@ "Sign in with a Microsoft account that owns Minecraft: Java Edition to play": "Connectez-vous avec un compte Microsoft qui possède Minecraft: Java Edition pour jouer", "Horizon needs a Microsoft account that owns Minecraft: Java Edition, like other launchers. It also plays online servers with your name and skin.": "Horizon a besoin d'un compte Microsoft qui possède Minecraft: Java Edition, comme les autres launchers. Il permet aussi de jouer sur les serveurs en ligne avec votre nom et votre skin.", "Sign in": "Se connecter", - "Sign in with Microsoft": "Se connecter avec Microsoft" + "Sign in with Microsoft": "Se connecter avec Microsoft", + "Not now": "Pas maintenant", + "Horizon needs a Microsoft account that owns Minecraft: Java Edition, like other launchers.": "Horizon a besoin d'un compte Microsoft qui possède Minecraft: Java Edition, comme les autres launchers.", + "Your worlds, offline names and settings stay where they are.": "Vos mondes, vos noms hors ligne et vos réglages restent où ils sont.", + "Open {link} in your browser and enter this code:": "Ouvrez {link} dans votre navigateur et entrez ce code :" } diff --git a/launcher/lang/ru.json b/launcher/lang/ru.json index ca14e22d7..8c8458a55 100644 --- a/launcher/lang/ru.json +++ b/launcher/lang/ru.json @@ -167,5 +167,9 @@ "Sign in with a Microsoft account that owns Minecraft: Java Edition to play": "Чтобы играть, войдите в аккаунт Microsoft, у которого есть Minecraft: Java Edition", "Horizon needs a Microsoft account that owns Minecraft: Java Edition, like other launchers. It also plays online servers with your name and skin.": "Как и другим лаунчерам, Horizon нужен аккаунт Microsoft, у которого есть Minecraft: Java Edition. С ним вы также играете на онлайн-серверах под своим именем и со своим скином.", "Sign in": "Войти", - "Sign in with Microsoft": "Войти через Microsoft" + "Sign in with Microsoft": "Войти через Microsoft", + "Not now": "Не сейчас", + "Horizon needs a Microsoft account that owns Minecraft: Java Edition, like other launchers.": "Как и другим лаунчерам, Horizon нужен аккаунт Microsoft, у которого есть Minecraft: Java Edition.", + "Your worlds, offline names and settings stay where they are.": "Ваши миры, офлайн-имена и настройки остаются на месте.", + "Open {link} in your browser and enter this code:": "Откройте {link} в браузере и введите этот код:" } diff --git a/launcher/src/backend.rs b/launcher/src/backend.rs index 2b97ecf6c..aacdf81ec 100644 --- a/launcher/src/backend.rs +++ b/launcher/src/backend.rs @@ -2625,6 +2625,10 @@ pub struct Settings { /// first-run question, or on the Play page once if they answered that before it existed. #[serde(default)] pub ping_notice_seen: bool, + /// The player without an account that owns the game has read, once, why the launcher needs + /// one now (the owner gate's screen). + #[serde(default)] + pub owner_notice_seen: bool, /// Seconds the sidebar's partner banner has been on screen, over every start, up to /// `partner::SEEN_BEFORE_HIDE`: only then can the player hide it. #[serde(default)] diff --git a/launcher/src/main.rs b/launcher/src/main.rs index fd3726da6..15ec943f2 100644 --- a/launcher/src/main.rs +++ b/launcher/src/main.rs @@ -27,6 +27,7 @@ mod modpacks_page; mod mods_page; mod mods_project; mod multiplayer_page; +mod owner_page; mod packs_page; mod partner; mod perf; @@ -210,6 +211,8 @@ struct Launcher { /// Whether an account here owns the game, by the keychain's last answers (the owner gate); /// none until the keychain has been read. owner: Option, + /// Play was refused (or Home's Sign in pressed): the owner gate's screen is open. + owner_screen_open: bool, /// The game is waiting for its session (a token renewal) before it starts. starting_client: Option, /// Join a friend: the code typed on the Play page, and the one the game @@ -415,6 +418,7 @@ impl Launcher { sign_in_state: None, keychain: true, owner: None, + owner_screen_open: false, starting_client: None, friend_code: String::new(), friend_focused: false, @@ -648,6 +652,7 @@ impl Launcher { Ok(pass) => pass, Err(account::NoOwner) => { self.owner = Some(false); + self.owner_screen_open = true; self.client_error = Some(format!("{}.", tr(account::NEEDS_OWNER))); self.starting_pack = None; self.joining = None; @@ -917,7 +922,12 @@ impl Launcher { self.accounts = Accounts::load(); // Sign-in refuses accounts that don't own the game. self.owner = Some(true); + self.owner_screen_open = false; self.client_error = None; + if !self.settings.owner_notice_seen { + self.settings.owner_notice_seen = true; + self.settings.save(); + } } self.sign_in_state = Some(state); changed = true; @@ -1088,7 +1098,7 @@ impl Launcher { }); } - /// Starts the Microsoft sign-in; Settings shows its code. + /// Starts the Microsoft sign-in; Settings and the owner gate's screen show its code. fn start_sign_in(&mut self) { if let Some(old) = self.sign_in.replace(SignIn::start()) { old.cancel(); @@ -2301,8 +2311,7 @@ impl Launcher { Some( button("gate-sign-in", "Sign in", Kind::Primary, &t) .on_click(cx.listener(|this, _: &ClickEvent, _, cx| { - this.start_sign_in(); - this.go(Page::Settings); + this.sign_in_to_play(); cx.notify(); })) .into_any_element(), @@ -3201,9 +3210,9 @@ impl Launcher { .flex() .flex_col() .gap(px(6.)) - .child(format!( - "Open {} in your browser and enter this code:", - code.verification_uri + .child(trf( + "Open {link} in your browser and enter this code:", + &[("link", &code.verification_uri)], )) .child( text(theme::HEADING) @@ -3907,6 +3916,9 @@ impl Render for Launcher { if self.asking_consent() { root = root.child(self.consent_screen(cx)); } + if self.asking_owner() { + root = root.child(self.owner_screen(cx)); + } if let Some(opening) = &self.opening { // The wordmark arrives letter by letter, then gives way to the launcher; a click or // a key skips ahead. diff --git a/launcher/src/owner_page.rs b/launcher/src/owner_page.rs new file mode 100644 index 000000000..5a27b064b --- /dev/null +++ b/launcher/src/owner_page.rs @@ -0,0 +1,157 @@ +//! The owner gate in the window (`horizon_launcher::account::launch`): the screen that asks for a +//! Microsoft account that owns Minecraft: Java Edition. It covers the launcher once for players +//! without one (those who played offline before the gate), and again whenever Play is refused. +//! The sign-in runs on it, code and all. +use super::*; + +impl Launcher { + /// Whether the screen covers the window: no owner, and either Play was refused or the player + /// hasn't read it yet. The data question comes first. + pub(crate) fn asking_owner(&self) -> bool { + self.owner == Some(false) + && (self.owner_screen_open || !self.settings.owner_notice_seen) + && !self.asking_consent() + && self.opening.is_none() + } + + /// Opens the screen and starts the sign-in on it. + pub(crate) fn sign_in_to_play(&mut self) { + self.owner_screen_open = true; + self.start_sign_in(); + } + + /// Closes it; it comes back with the next refused Play. + fn close_owner_screen(&mut self) { + if let Some(s) = self.sign_in.take() { + s.cancel(); + } + self.sign_in_state = None; + self.owner_screen_open = false; + if !self.settings.owner_notice_seen { + self.settings.owner_notice_seen = true; + self.settings.save(); + } + } + + pub(crate) fn owner_screen(&mut self, cx: &mut Context) -> Stateful
{ + let t = self.theme; + let configured = account::client_id().is_some(); + let mut body = div() + .flex() + .flex_col() + .gap(px(12.)) + .p(px(28.)) + .child(caps(tr("Microsoft account")).text_color(t.muted)) + .child( + text(theme::HEADING) + .text_color(t.ink) + .child(format!("{}.", tr(account::NEEDS_OWNER))), + ) + .child(text(theme::UI).text_color(t.muted).child(tr( + "Horizon needs a Microsoft account that owns Minecraft: Java Edition, like other launchers.", + ))) + .child(text(theme::UI).text_color(t.muted).child(tr( + "Your worlds, offline names and settings stay where they are.", + ))); + let status = match &self.sign_in_state { + _ if !configured => Some(div().child(tr(account::NOT_CONFIGURED))), + Some(SignInState::Starting) => Some(div().child(tr("Asking Microsoft…"))), + Some(SignInState::Code(code)) => Some( + div() + .flex() + .flex_col() + .gap(px(6.)) + .child(trf( + "Open {link} in your browser and enter this code:", + &[("link", &code.verification_uri)], + )) + .child( + text(theme::HEADING) + .font_family(theme::MONO) + .text_color(t.ink) + .child(code.user_code.clone()), + ), + ), + Some(SignInState::Done(Err(e))) => Some(div().text_color(t.danger).child(e.clone())), + Some(SignInState::Done(Ok(_))) | None => None, + }; + body = body.children(status.map(|s| { + plate(&t) + .p(px(16.)) + .text_size(px(theme::UI.px)) + .text_color(t.ink_soft) + .child(s) + })); + let mut answers = div() + .flex() + .justify_end() + .gap(px(12.)) + .px(px(28.)) + .pb(px(28.)) + .child( + button("owner-later", "Not now", Kind::Secondary, &t).on_click(cx.listener( + |this, _: &ClickEvent, _, cx| { + this.close_owner_screen(); + cx.notify(); + }, + )), + ); + answers = match &self.sign_in_state { + Some(SignInState::Code(code)) => { + let (uri, user_code) = (code.verification_uri.clone(), code.user_code.clone()); + answers + .child( + button("owner-copy", "Copy code", Kind::Secondary, &t).on_click( + move |_, _, cx| { + copy_to_clipboard( + cx, + gpui::ClipboardItem::new_string(user_code.clone()), + ) + }, + ), + ) + .child( + button("owner-open", "Open link", Kind::Primary, &t) + .on_click(move |_, _, cx| cx.open_url(&uri)), + ) + } + Some(SignInState::Starting) => answers, + _ if !configured => answers, + _ => answers.child( + button("owner-sign-in", "Sign in", Kind::Primary, &t).on_click(cx.listener( + |this, _: &ClickEvent, _, cx| { + this.sign_in_to_play(); + cx.notify(); + }, + )), + ), + }; + let card = plate(&t) + .flex() + .flex_col() + // A set width: text measured at it wraps where it is drawn. + .w(px(560.)) + .max_w_full() + .bg(t.page) + .border_1() + .border_color(t.rule) + .child(body) + .child(answers); + div() + .id("owner-gate") + .absolute() + .top_0() + .left_0() + .size_full() + .flex() + .flex_col() + .items_center() + .justify_center() + .px(px(32.)) + .py(px(24.)) + .bg(t.page.opacity(0.92)) + .on_scroll_wheel(|_, _, cx| cx.stop_propagation()) + .occlude() + .child(card) + } +} From 610c2f3c10ff5cdda4408afd17463e8aaad85a1f Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Tue, 27 Oct 2026 18:33:53 +0100 Subject: [PATCH 08/11] launcher: Download and prepare, from Mojang, for an account that owns the game With the owner gate in place, a signed-in owner no longer needs another launcher first (brief mc-download-1, Ludovic 2026-10-27). - The Play page's Resources row offers an owner "Download and prepare" and "From my install"; without an owner it asks to sign in first. - `horizon-launcher prepare --download` does the same. - Every file from Mojang must have the size and sha1 Mojang lists. - The download shows its progress and has Cancel; files already whole are kept, so the next try goes on where it stopped. Co-Authored-By: Claude Opus 5.5 --- docs/launcher-commands.md | 3 +- docs/microsoft-account.md | 11 +++ launcher/README.md | 9 +++ launcher/lang/fr.json | 7 +- launcher/lang/ru.json | 7 +- launcher/src/backend.rs | 41 +++++++--- launcher/src/cli.rs | 21 ++++- launcher/src/main.rs | 86 ++++++++++++++++++-- launcher/src/mojang.rs | 85 ++++++++++++++++---- launcher/src/mojang_tests.rs | 148 ++++++++++++++++++++++++++++++++--- launcher/src/servers_page.rs | 2 +- 11 files changed, 367 insertions(+), 53 deletions(-) diff --git a/docs/launcher-commands.md b/docs/launcher-commands.md index df098faa6..d5ed3491a 100644 --- a/docs/launcher-commands.md +++ b/docs/launcher-commands.md @@ -36,11 +36,12 @@ MCP: `remove`, needs `confirm: true`. ## `horizon-launcher prepare` -Prepare a version's resources from your own Minecraft install. +Prepare a version's resources from your own Minecraft install, or from Mojang. horizon-launcher prepare - `--minecraft`: The game folder of the official launcher, Prism Launcher, MultiMC, the Modrinth App, ATLauncher or GDLauncher (default: the launcher's, then every launcher's default) +- `--download`: Download Minecraft from Mojang for the signed-in account that owns it, instead of using an install MCP: `prepare`. diff --git a/docs/microsoft-account.md b/docs/microsoft-account.md index 9c457f8a0..33207da33 100644 --- a/docs/microsoft-account.md +++ b/docs/microsoft-account.md @@ -93,6 +93,17 @@ possible; the launcher just doesn't offer it on its own. the launcher's tests use accounts in a memory store (`MemoryStore`, and `HORIZON_NO_KEYCHAIN` for the CLI and MCP tests, which then have no owner). +## Downloading the game for an owner + +Decided 2026-10-27. This is the only exception to "Horizon never downloads the game", and it +applies only on the player's machine, for an account the owner gate just asked about. The +launcher's "Download and prepare" (`horizon-launcher prepare --download`) fetches the pinned +version straight from Mojang (`launcher/src/mojang.rs`): the version file, the client jar, +libraries, the asset index and the assets, each checked against the size and sha1 Mojang lists. +They go to `minecraft/` in the launcher's data folder, and the preparation runs as usual. The +download can be cancelled and goes on where it stopped. CI, agents, harnesses and the repo never +download or keep Mojang's files. + Refresh: the Minecraft token is renewed from the Microsoft refresh token (steps 2-5 with `grant_type=refresh_token`) when it has less than an hour left, before every launch; steps 6-7 run at every launch (the owner gate). A refused diff --git a/launcher/README.md b/launcher/README.md index b2b497753..9ded5d621 100644 --- a/launcher/README.md +++ b/launcher/README.md @@ -24,6 +24,15 @@ The opening, then Play ([clip](docs/opening.webm)): preparation reuses checksum-verified game jars and libraries from the current or another installed Horizon version, so the original Minecraft install is only required when no valid imported copy exists. +- **Download and prepare**: for a signed-in account that owns the game (asked again first), + the launcher downloads the pinned version from Mojang itself (piston-meta, piston-data, + libraries.minecraft.net, resources.download.minecraft.net; never a mirror) into `minecraft/` + in its data folder, in the official launcher's layout: the version file, the client jar, this + system's libraries, the asset index and the assets. Every file must have the size and sha1 + Mojang lists. The Play page shows how far it is and has Cancel; files already whole are kept, + so the next try goes on from there. **From my install** prepares from the player's own launcher + instead, and an install that lacks the version falls back to the download. Without an owner, + the Play page asks to sign in first. `horizon-launcher prepare --download`. - **Mods**: search Modrinth (CurseForge support is coming soon) for resource packs and modpacks, each marked Works, Partly or Doesn't run in Horizon; Java mod jars are never offered. Install puts a pack and what it needs in diff --git a/launcher/lang/fr.json b/launcher/lang/fr.json index 85c8238e8..a8532491e 100644 --- a/launcher/lang/fr.json +++ b/launcher/lang/fr.json @@ -171,5 +171,10 @@ "Not now": "Pas maintenant", "Horizon needs a Microsoft account that owns Minecraft: Java Edition, like other launchers.": "Horizon a besoin d'un compte Microsoft qui possède Minecraft: Java Edition, comme les autres launchers.", "Your worlds, offline names and settings stay where they are.": "Vos mondes, vos noms hors ligne et vos réglages restent où ils sont.", - "Open {link} in your browser and enter this code:": "Ouvrez {link} dans votre navigateur et entrez ce code :" + "Open {link} in your browser and enter this code:": "Ouvrez {link} dans votre navigateur et entrez ce code :", + "From my install": "Depuis mon installation", + "Download and prepare": "Télécharger et préparer", + "Not prepared. Horizon can download Minecraft {version} from Mojang for your account, or use your own install.": "Pas préparé. Horizon peut télécharger Minecraft {version} depuis Mojang pour votre compte, ou utiliser votre propre installation.", + "Not prepared. Sign in with the Microsoft account that owns Minecraft {version} first.": "Pas préparé. Connectez-vous d'abord avec le compte Microsoft qui possède Minecraft {version}.", + "Cancel": "Annuler" } diff --git a/launcher/lang/ru.json b/launcher/lang/ru.json index 8c8458a55..9fa58b990 100644 --- a/launcher/lang/ru.json +++ b/launcher/lang/ru.json @@ -171,5 +171,10 @@ "Not now": "Не сейчас", "Horizon needs a Microsoft account that owns Minecraft: Java Edition, like other launchers.": "Как и другим лаунчерам, Horizon нужен аккаунт Microsoft, у которого есть Minecraft: Java Edition.", "Your worlds, offline names and settings stay where they are.": "Ваши миры, офлайн-имена и настройки остаются на месте.", - "Open {link} in your browser and enter this code:": "Откройте {link} в браузере и введите этот код:" + "Open {link} in your browser and enter this code:": "Откройте {link} в браузере и введите этот код:", + "From my install": "Из моей установки", + "Download and prepare": "Скачать и подготовить", + "Not prepared. Horizon can download Minecraft {version} from Mojang for your account, or use your own install.": "Не подготовлено. Horizon может скачать Minecraft {version} у Mojang для вашего аккаунта или взять вашу установку.", + "Not prepared. Sign in with the Microsoft account that owns Minecraft {version} first.": "Не подготовлено. Сначала войдите в аккаунт Microsoft, у которого есть Minecraft {version}.", + "Cancel": "Отмена" } diff --git a/launcher/src/backend.rs b/launcher/src/backend.rs index aacdf81ec..cd72440a6 100644 --- a/launcher/src/backend.rs +++ b/launcher/src/backend.rs @@ -1227,7 +1227,7 @@ fn download_for_owner( sources::Os::MacOs => "osx", sources::Os::Windows => "windows", }; - mojang::download(pins, dir, os, 8, fetch, log).map_err(|e| { + mojang::download(pins, dir, os, 8, fetch, &mojang::CANCEL, log).map_err(|e| { format!("\n • Horizon tried to download {v} from Mojang for {name}, but: {e}") }) } @@ -1299,7 +1299,8 @@ fn java( Ok(body) }; let runtime = data_dir().join("minecraft").join("runtime"); - let home = mojang::java_runtime(&component, &runtime, 8, &fetch, log).map_err(|e| { + let home = mojang::java_runtime(&component, &runtime, 8, &fetch, &mojang::CANCEL, log) + .map_err(|e| { format!("{missing}\n • Horizon also tried to download Minecraft's own Java from Mojang, but: {e}") })?; find(major, &[home]).map(|jdk| jdk.home()) @@ -1351,6 +1352,16 @@ fn assets_folder( } } +/// Where the preparation takes Minecraft's files from. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum MinecraftFrom { + /// The player's own install (any launcher's); Mojang only when none has the version and an + /// account that owns the game is signed in. + Install, + /// Mojang, for the signed-in account that owns the game ("Download and prepare"). + Mojang, +} + /// Checks what the preparation needs and picks how to run it. PLAY.txt describes the same /// steps: the player's own launcher install, the server jar from that version's own json, and /// Java (and Python, for versions before horizon-prepare). Also returns the Minecraft folder @@ -1359,6 +1370,7 @@ fn assets_folder( pub fn preparer( tag: &str, minecraft: &Path, + from: MinecraftFrom, log: &dyn Fn(String), ) -> Result<(Preparer, PathBuf), String> { let version = game_version(tag); @@ -1386,16 +1398,23 @@ pub fn preparer( Ok(body) }; let linked = data_dir().join("linked-minecraft"); - let resolved = sources::resolve(minecraft, &pins, &known, &linked, &fetch, log); - if reused { - assets_folder(resolved, &chosen, &version, log) + if from == MinecraftFrom::Mojang { + // Straight from Mojang (what is already there and whole is kept), for an owner only. + download_for_owner(&pins, &own, &fetch, log) + .map_err(|e| e.trim_start_matches("\n • ").to_string())?; + own } else { - match resolved? { - sources::Resolved::Folder(dir) => dir, - sources::Resolved::NotFound(checked) => { - let not_found = sources::not_found(&version, &checked, minecraft); - download_for_owner(&pins, &own, &fetch, log).map_err(|e| not_found + &e)?; - own + let resolved = sources::resolve(minecraft, &pins, &known, &linked, &fetch, log); + if reused { + assets_folder(resolved, &chosen, &version, log) + } else { + match resolved? { + sources::Resolved::Folder(dir) => dir, + sources::Resolved::NotFound(checked) => { + let not_found = sources::not_found(&version, &checked, minecraft); + download_for_owner(&pins, &own, &fetch, log).map_err(|e| not_found + &e)?; + own + } } } } diff --git a/launcher/src/cli.rs b/launcher/src/cli.rs index 6fb73af5d..7d71084f3 100644 --- a/launcher/src/cli.rs +++ b/launcher/src/cli.rs @@ -548,12 +548,16 @@ enum Cmd { Install { tag: String }, /// Remove an installed version Remove { tag: String }, - /// Prepare a version's resources from your own Minecraft install + /// Prepare a version's resources from your own Minecraft install, or from Mojang Prepare { /// The game folder of the official launcher, Prism Launcher, MultiMC, the Modrinth App, /// ATLauncher or GDLauncher (default: the launcher's, then every launcher's default) - #[arg(long)] + #[arg(long, conflicts_with = "download")] minecraft: Option, + /// Download Minecraft from Mojang for the signed-in account that owns it, instead of + /// using an install + #[arg(long)] + download: bool, /// The installed version (default: the selected one) #[arg(long)] version: Option, @@ -974,11 +978,20 @@ fn execute(command: Cmd, as_json: bool) -> Result<(), String> { backend::remove_version(&tag)?; println!("Removed {tag}."); } - Cmd::Prepare { minecraft, version } => { + Cmd::Prepare { + minecraft, + download, + version, + } => { let tag = backend::resolve_version(version.as_deref())?; let minecraft = backend::minecraft_dir(minecraft)?; + let from = if download { + backend::MinecraftFrom::Mojang + } else { + backend::MinecraftFrom::Install + }; let (preparer, minecraft) = - backend::preparer(&tag, &minecraft, &|line| eprintln!("{line}"))?; + backend::preparer(&tag, &minecraft, from, &|line| eprintln!("{line}"))?; backend::sounds(&tag, &minecraft, &|line| println!("{line}")); match preparer { backend::Preparer::Process(cmd) => attached(cmd)?, diff --git a/launcher/src/main.rs b/launcher/src/main.rs index 15ec943f2..135769376 100644 --- a/launcher/src/main.rs +++ b/launcher/src/main.rs @@ -1021,10 +1021,13 @@ impl Launcher { }); } - fn prepare(&mut self) { + /// Prepares the selected version, its Minecraft files from the player's install or, for an + /// owner who asks, from Mojang. + fn prepare(&mut self, from: backend::MinecraftFrom) { let Some(tag) = self.selected().cloned() else { return; }; + horizon_launcher::mojang::CANCEL.store(false, Ordering::Relaxed); let minecraft = self .settings .minecraft_dir @@ -1040,7 +1043,7 @@ impl Launcher { let log = |line| { let _ = tx.send(Msg::Line(Job::Prepare, line)); }; - let result = backend::preparer(&tag, &minecraft, &log) + let result = backend::preparer(&tag, &minecraft, from, &log) .inspect(|(_, minecraft)| backend::sounds(&tag, minecraft, &log)) .and_then(|(p, _)| match p { backend::Preparer::Process(cmd) => { @@ -2232,10 +2235,22 @@ impl Launcher { .child(play), ); - let resources_value = if self.preparing { - tr("Preparing…").to_string() - } else { - backend::resources_summary(prepared, !silent, &version) + // Not prepared: an owner can have Horizon download Minecraft from Mojang; without an + // owner there is nothing to play, so signing in comes first. + let first = (!prepared && !self.preparing) + .then_some(self.owner) + .flatten(); + let resources_value = match first { + _ if self.preparing => tr("Preparing…").to_string(), + Some(true) => trf( + "Not prepared. Horizon can download Minecraft {version} from Mojang for your account, or use your own install.", + &[("version", &version)], + ), + Some(false) => trf( + "Not prepared. Sign in with the Microsoft account that owns Minecraft {version} first.", + &[("version", &version)], + ), + None => backend::resources_summary(prepared, !silent, &version), }; let mut prepare = button( "prepare", @@ -2251,10 +2266,44 @@ impl Launcher { prepare = disabled(prepare); } else { prepare = prepare.on_click(cx.listener(|this, _: &ClickEvent, _, cx| { - this.prepare(); + this.prepare(backend::MinecraftFrom::Install); cx.notify(); })); } + let prepare = match first { + Some(true) => div() + .flex() + .gap(px(8.)) + .child( + button("prepare-install", "From my install", Kind::Ghost, &t).on_click( + cx.listener(|this, _: &ClickEvent, _, cx| { + this.prepare(backend::MinecraftFrom::Install); + cx.notify(); + }), + ), + ) + .child( + button( + "prepare-download", + "Download and prepare", + Kind::Secondary, + &t, + ) + .on_click(cx.listener(|this, _: &ClickEvent, _, cx| { + this.prepare(backend::MinecraftFrom::Mojang); + cx.notify(); + })), + ), + Some(false) => div().child( + button("prepare-sign-in", "Sign in", Kind::Secondary, &t).on_click(cx.listener( + |this, _: &ClickEvent, _, cx| { + this.sign_in_to_play(); + cx.notify(); + }, + )), + ), + None => div().child(prepare), + }; let minecraft = self.settings.minecraft_dir.as_deref().map_or_else( || { div() @@ -2394,12 +2443,33 @@ impl Launcher { // looks after pressing Prepare, not below the fold (#666). if self.preparing { let last = self.prepare_log.back().cloned().unwrap_or_default(); + // A download from Mojang shows how far it is, and can stop (it goes on from there + // next time). + let download = horizon_launcher::mojang::progress(); + let cancel = download.map(|_| { + button("download-cancel", "Cancel", Kind::Ghost, &t).on_click(|_, _, _| { + horizon_launcher::mojang::CANCEL.store(true, Ordering::Relaxed) + }) + }); page = page.child( div() .flex() .flex_col() .gap(px(10.)) - .child(progress_bar(None, &t)) + .child( + div() + .flex() + .items_center() + .gap(px(12.)) + .child(progress_bar( + download.map(|(done, total)| { + let f = done as f32 / total as f32; + (f, f) + }), + &t, + )) + .children(cancel), + ) .child( text(theme::MICRO) .text_color(t.muted) diff --git a/launcher/src/mojang.rs b/launcher/src/mojang.rs index f242672b9..32688f667 100644 --- a/launcher/src/mojang.rs +++ b/launcher/src/mojang.rs @@ -3,12 +3,16 @@ //! jar, this system's libraries and the assets (the sounds), each checked against its sha1, //! in the official launcher's layout in the launcher's data folder. sources.rs then finds them //! there like any launcher's. Nothing of Mojang's is part of Horizon. +//! +//! Each file is checked against the size and sha1 Mojang lists, and written whole. A download +//! stopped half way (cancelled, no network) keeps the files it finished: the next one fetches +//! only the rest. -use crate::sources::{fetch_checked, fetch_manifest, sha1_file, write_file, Fetch, Pins}; +use crate::sources::{fetch_checked, fetch_manifest, sha1_file, sha1_hex, write_file, Fetch, Pins}; use serde_json::Value; use std::fs; use std::path::{Component, Path, PathBuf}; -use std::sync::atomic::{AtomicUsize, Ordering::Relaxed}; +use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering::Relaxed}; use std::sync::Mutex; use std::time::Duration; @@ -16,22 +20,38 @@ const OBJECTS: &str = "https://resources.download.minecraft.net"; /// The index of Mojang's Java runtimes, the one the official launcher reads. const JAVA_RUNTIMES: &str = "https://launchermeta.mojang.com/v1/products/java-runtime/2ec0cc96c44e5a76b9c8b7c39df7210883d12871/all.json"; -/// One file to download. +/// Set to stop the download under way (the window's Cancel); cleared when a preparation starts. +pub static CANCEL: AtomicBool = AtomicBool::new(false); +/// The download under way: files done, of how many (0 when none runs). +static DONE: AtomicUsize = AtomicUsize::new(0); +static TOTAL: AtomicUsize = AtomicUsize::new(0); + +/// How far the download under way is, files done of how many; none when none runs. +pub fn progress() -> Option<(usize, usize)> { + let total = TOTAL.load(Relaxed); + (total > 0).then(|| (DONE.load(Relaxed).min(total), total)) +} + +const CANCELLED: &str = "Download cancelled. Download again to go on where it stopped."; + +/// One file to download, with the size Mojang lists for it when it lists one. struct File { url: String, sha1: String, + size: Option, path: PathBuf, } /// Downloads the pinned version into `dir`, `jobs` files at a time; files already there and /// whole are kept. An asset that fails is a line in the log (the game is then partly silent), -/// anything else an error. +/// anything else an error. `cancel` stops it between files. pub fn download( pins: &Pins, dir: &Path, os: &str, jobs: usize, fetch: Fetch, + cancel: &AtomicBool, log: &dyn Fn(String), ) -> Result<(), String> { let v = &pins.version; @@ -43,6 +63,7 @@ pub fn download( let mut game = vec![File { url: text(client, "url")?, sha1: pins.client_sha1.clone(), + size: client["size"].as_u64(), path: versions.join(format!("{v}.jar")), }]; let libraries = manifest["libraries"] @@ -56,6 +77,7 @@ pub fn download( game.push(File { url: text(artifact, "url")?, sha1: text(artifact, "sha1")?, + size: artifact["size"].as_u64(), path: dir .join("libraries") .join(relative(&text(artifact, "path")?)?), @@ -65,23 +87,26 @@ pub fn download( "Downloading Minecraft {v} from Mojang: the game and {} libraries", game.len() - 1 )); - fetch_all(&game, jobs, fetch, log)?; + fetch_all(&game, jobs, fetch, cancel, log)?; let index = &manifest["assetIndex"]; let index = File { url: text(index, "url")?, sha1: text(index, "sha1")?, + size: index["size"].as_u64(), path: dir .join("assets/indexes") .join(relative(&format!("{}.json", text(index, "id")?))?), }; - let assets = fetch_all(std::slice::from_ref(&index), 1, fetch, log) + let assets = fetch_all(std::slice::from_ref(&index), 1, fetch, cancel, log) .and_then(|_| objects(&read_json(&index.path)?, dir)) .and_then(|objects| { log(format!("Downloading the sounds ({} files)", objects.len())); - fetch_all(&objects, jobs, fetch, log) + fetch_all(&objects, jobs, fetch, cancel, log) }); - if let Err(e) = assets { - log(format!("The sounds could not all be downloaded: {e}")); + match assets { + Err(e) if e == CANCELLED => return Err(e), + Err(e) => log(format!("The sounds could not all be downloaded: {e}")), + Ok(()) => {} } Ok(()) } @@ -110,6 +135,7 @@ pub fn java_runtime( runtime: &Path, jobs: usize, fetch: Fetch, + cancel: &AtomicBool, log: &dyn Fn(String), ) -> Result { let platform = java_platform().ok_or("Mojang has no Java for this system")?; @@ -144,6 +170,7 @@ pub fn java_runtime( downloads.push(File { url: text(raw, "url")?, sha1: text(raw, "sha1")?, + size: raw["size"].as_u64(), path, }); } @@ -156,7 +183,7 @@ pub fn java_runtime( "Downloading Minecraft's Java {name} from Mojang ({} files)", downloads.len() )); - fetch_all(&downloads, jobs, fetch, log)?; + fetch_all(&downloads, jobs, fetch, cancel, log)?; #[cfg(unix)] { use std::os::unix::fs::PermissionsExt; @@ -243,6 +270,10 @@ fn objects(index: &Value, dir: &Path) -> Result, String> { let objects = index["objects"] .as_object() .ok_or("The asset index has no objects")?; + let sizes: std::collections::HashMap<&str, u64> = objects + .values() + .filter_map(|o| Some((o["hash"].as_str()?, o["size"].as_u64()?))) + .collect(); let mut hashes: Vec<&str> = objects .values() .filter_map(|o| o["hash"].as_str()) @@ -259,23 +290,42 @@ fn objects(index: &Value, dir: &Path) -> Result, String> { Ok(File { url: format!("{OBJECTS}/{path}"), sha1: hash.to_string(), + size: sizes.get(hash).copied(), path: dir.join("assets/objects").join(path), }) }) .collect() } -/// Downloads the files not already there, `jobs` at a time, with a line every few seconds; -/// stops at the first error. +/// One file from Mojang, refused unless it has the size and sha1 Mojang lists. +fn fetch_file(fetch: Fetch, file: &File) -> Result, String> { + let body = fetch(&file.url)?; + if let Some(size) = file.size.filter(|&size| size != body.len() as u64) { + return Err(format!( + "is {} bytes, not the {size} Mojang lists", + body.len() + )); + } + match sha1_hex(&body) { + actual if actual == file.sha1 => Ok(body), + actual => Err(format!("is not the one Horizon pins (sha1 {actual})")), + } +} + +/// Downloads the files not already there, `jobs` at a time, with a line every second; stops at +/// the first error, or between files once `cancel` is set. fn fetch_all( files: &[File], jobs: usize, fetch: Fetch, + cancel: &AtomicBool, log: &dyn Fn(String), ) -> Result<(), String> { let next = AtomicUsize::new(0); let done = AtomicUsize::new(0); let failed = Mutex::new(None); + DONE.store(0, Relaxed); + TOTAL.store(files.len(), Relaxed); std::thread::scope(|scope| { let workers: Vec<_> = (0..jobs.clamp(1, files.len().max(1))) .map(|_| { @@ -284,15 +334,19 @@ fn fetch_all( if failed.lock().unwrap().is_some() { break; } + if cancel.load(Relaxed) { + failed.lock().unwrap().get_or_insert(CANCELLED.to_string()); + break; + } if sha1_file(&file.path).as_ref() != Some(&file.sha1) { - let got = fetch_checked(fetch, &file.url, &file.sha1) + let got = fetch_file(fetch, file) .map_err(|e| format!("{} {e}", file.url)) .and_then(|body| write_file(&file.path, &body)); if let Err(e) = got { failed.lock().unwrap().get_or_insert(e); } } - done.fetch_add(1, Relaxed); + DONE.store(done.fetch_add(1, Relaxed) + 1, Relaxed); } }) }) @@ -301,11 +355,12 @@ fn fetch_all( while !workers.iter().all(|w| w.is_finished()) { std::thread::sleep(Duration::from_millis(100)); waited += 1; - if waited % 50 == 0 { + if waited % 10 == 0 { log(format!("{} of {} files", done.load(Relaxed), files.len())); } } }); + TOTAL.store(0, Relaxed); failed.into_inner().unwrap().map_or(Ok(()), Err) } diff --git a/launcher/src/mojang_tests.rs b/launcher/src/mojang_tests.rs index cd32e4c79..310fd72c2 100644 --- a/launcher/src/mojang_tests.rs +++ b/launcher/src/mojang_tests.rs @@ -8,6 +8,8 @@ const COMMON: &[u8] = b"a library every system uses"; const LINUX: &[u8] = b"a linux native"; const SOUND: &[u8] = b"a fake ogg"; const LANG: &[u8] = b"{}"; +/// Never cancelled. +static GO: AtomicBool = AtomicBool::new(false); /// The fake version file, asset index and files, by URL. fn mojang() -> (Pins, HashMap>) { @@ -28,7 +30,7 @@ fn mojang() -> (Pins, HashMap>) { "id": "26.3", "assetIndex": {"id": "34", "sha1": sha1_hex(index.as_bytes()), "url": "https://piston-meta.mojang.com/v1/packages/i/34.json"}, - "downloads": {"client": {"sha1": sha1_hex(CLIENT), "url": "https://piston-data.mojang.com/client.jar"}}, + "downloads": {"client": {"sha1": sha1_hex(CLIENT), "size": CLIENT.len(), "url": "https://piston-data.mojang.com/client.jar"}}, "libraries": [ {"name": "org.fake:common:1", "downloads": {"artifact": artifact("common", COMMON)}}, {"name": "org.fake:linux:1", "downloads": {"artifact": artifact("linux", LINUX)}, @@ -112,9 +114,15 @@ fn an_owner_gets_the_official_layout_with_this_systems_libraries() { }; let dir = scratch("layout"); let logged = Mutex::new(Vec::new()); - download(&pins, &dir, "linux", 3, &|url| server.fetch(url), &|line| { - logged.lock().unwrap().push(line) - }) + download( + &pins, + &dir, + "linux", + 3, + &|url| server.fetch(url), + &GO, + &|line| logged.lock().unwrap().push(line), + ) .unwrap(); assert_eq!( fs::read(dir.join("versions/26.3/26.3.jar")).unwrap(), @@ -156,7 +164,16 @@ fn an_owner_gets_the_official_layout_with_this_systems_libraries() { &|_| {}, ); assert_eq!(found, Ok(Resolved::Folder(dir.clone()))); - download(&pins, &dir, "linux", 3, &|url| server.fetch(url), &|_| {}).unwrap(); + download( + &pins, + &dir, + "linux", + 3, + &|url| server.fetch(url), + &GO, + &|_| {}, + ) + .unwrap(); assert_eq!(server.asked(), Vec::::new()); fs::remove_dir_all(&dir).unwrap(); } @@ -169,7 +186,16 @@ fn macos_skips_what_its_rules_disallow() { asked: Mutex::new(Vec::new()), }; let dir = scratch("osx"); - download(&pins, &dir, "osx", 2, &|url| server.fetch(url), &|_| {}).unwrap(); + download( + &pins, + &dir, + "osx", + 2, + &|url| server.fetch(url), + &GO, + &|_| {}, + ) + .unwrap(); let libraries = dir.join("libraries/org/fake"); assert!(libraries.join("common/1/common-1.jar").is_file()); assert!(!libraries.join("linux").exists()); @@ -182,14 +208,23 @@ fn a_file_that_is_not_the_pinned_one_stops_the_download() { let (pins, mut files) = mojang(); files.insert( "https://piston-data.mojang.com/client.jar".into(), - b"something else".to_vec(), + b"fake client JAR".to_vec(), ); let server = Server { files, asked: Mutex::new(Vec::new()), }; let dir = scratch("bad-jar"); - let error = download(&pins, &dir, "linux", 2, &|url| server.fetch(url), &|_| {}).unwrap_err(); + let error = download( + &pins, + &dir, + "linux", + 2, + &|url| server.fetch(url), + &GO, + &|_| {}, + ) + .unwrap_err(); assert!( error.starts_with("https://piston-data.mojang.com/client.jar is not the one Horizon pins"), "{error}" @@ -209,9 +244,15 @@ fn missing_sounds_are_a_line_in_the_log_not_an_error() { }; let dir = scratch("no-sound"); let logged = Mutex::new(Vec::new()); - download(&pins, &dir, "linux", 1, &|url| server.fetch(url), &|line| { - logged.lock().unwrap().push(line) - }) + download( + &pins, + &dir, + "linux", + 1, + &|url| server.fetch(url), + &GO, + &|line| logged.lock().unwrap().push(line), + ) .unwrap(); assert!(dir.join("versions/26.3/26.3.jar").is_file()); let last = logged.lock().unwrap().last().cloned().unwrap(); @@ -290,6 +331,7 @@ fn java_runtime_lays_out_mojangs_runtime_with_its_executables_and_links() { &dir, 2, &|url| server.fetch(url), + &GO, &|_| {}, ) .unwrap(); @@ -316,6 +358,7 @@ fn java_runtime_lays_out_mojangs_runtime_with_its_executables_and_links() { &dir, 2, &|url| server.fetch(url), + &GO, &|_| {}, ) .unwrap(); @@ -325,8 +368,91 @@ fn java_runtime_lays_out_mojangs_runtime_with_its_executables_and_links() { &dir, 2, &|url| server.fetch(url), + &GO, &|_| {} ) .is_err()); fs::remove_dir_all(&dir).unwrap(); } + +#[test] +fn a_file_of_another_size_than_mojang_lists_is_refused() { + let (pins, mut files) = mojang(); + // A cut-off body: its size says so before its sha1. + files.insert( + "https://piston-data.mojang.com/client.jar".into(), + CLIENT[..4].to_vec(), + ); + let server = Server { + files, + asked: Mutex::new(Vec::new()), + }; + let dir = scratch("size"); + let error = download( + &pins, + &dir, + "linux", + 2, + &|url| server.fetch(url), + &GO, + &|_| {}, + ) + .unwrap_err(); + assert!( + error.ends_with(&format!( + "is 4 bytes, not the {} Mojang lists", + CLIENT.len() + )), + "{error}" + ); + assert!(!dir.join("versions/26.3/26.3.jar").exists()); + fs::remove_dir_all(&dir).unwrap(); +} + +#[test] +fn a_cancelled_download_goes_on_where_it_stopped() { + let (pins, files) = mojang(); + let server = Server { + files, + asked: Mutex::new(Vec::new()), + }; + let dir = scratch("cancel"); + let cancel = AtomicBool::new(false); + // Cancelled once the client jar has arrived: one job, so nothing after it starts. + let fetch = |url: &str| { + let body = server.fetch(url); + if url.ends_with("client.jar") { + cancel.store(true, Relaxed); + } + body + }; + let error = download(&pins, &dir, "linux", 1, &fetch, &cancel, &|_| {}).unwrap_err(); + assert_eq!(error, CANCELLED); + assert_eq!( + fs::read(dir.join("versions/26.3/26.3.jar")).unwrap(), + CLIENT + ); + assert!(!dir.join("libraries").exists()); + // Again: the version file and the jar are kept, only the rest is fetched. + cancel.store(false, Relaxed); + server.asked(); + download( + &pins, + &dir, + "linux", + 1, + &|url| server.fetch(url), + &cancel, + &|_| {}, + ) + .unwrap(); + let asked = server.asked(); + assert!( + !asked + .iter() + .any(|u| u.ends_with("client.jar") || u.ends_with("26.3.json")), + "{asked:#?}" + ); + assert_eq!(asked.len(), 6, "{asked:#?}"); + fs::remove_dir_all(&dir).unwrap(); +} diff --git a/launcher/src/servers_page.rs b/launcher/src/servers_page.rs index e3ed4f441..49ca08ddd 100644 --- a/launcher/src/servers_page.rs +++ b/launcher/src/servers_page.rs @@ -782,7 +782,7 @@ impl Launcher { self.servers.create = None; self.go(Page::Play); if !self.preparing { - self.prepare(); + self.prepare(backend::MinecraftFrom::Install); } } }, From d87b081c3471e2aaaa62db53f4d60430845cbd42 Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Tue, 27 Oct 2026 19:21:08 +0100 Subject: [PATCH 09/11] Trusted reviewers triage on GitHub: /close, /reopen, /label, /unlabel One list (.github/trusted-reviewers.txt) now governs /nightly and the triage commands. Co-Authored-By: Claude Sonnet 5.5 --- .github/nightly-reviewers.txt | 7 - .github/trusted-reviewers.txt | 8 + .github/workflows/nightly-command.yml | 4 +- .github/workflows/triage-command.yml | 48 +++++ docs/release-flow.md | 34 +++- tests/test_triage_command.py | 239 +++++++++++++++++++++++ tools/ci/nightly_set.py | 4 +- tools/ci/triage_command.py | 270 ++++++++++++++++++++++++++ 8 files changed, 599 insertions(+), 15 deletions(-) delete mode 100644 .github/nightly-reviewers.txt create mode 100644 .github/trusted-reviewers.txt create mode 100644 .github/workflows/triage-command.yml create mode 100644 tests/test_triage_command.py create mode 100644 tools/ci/triage_command.py diff --git a/.github/nightly-reviewers.txt b/.github/nightly-reviewers.txt deleted file mode 100644 index a2f9606aa..000000000 --- a/.github/nightly-reviewers.txt +++ /dev/null @@ -1,7 +0,0 @@ -# Trusted reviewers: they pick the pull requests the Nightly holds with `/nightly 2640 2642` in any issue or pull -# request (docs/release-flow.md "Nightly channel", tools/ci/nightly_set.py). Ludovic is always allowed and isn't -# listed. One GitHub login per line, with who added it and when. Removing a line revokes that login at once. -# A line with only `paused` stops every reviewer's `/nightly` (Ludovic's still work). -kacpherek # added by Ludovic, 2026-10-27 -rdbtCVS # added by Ludovic, 2026-10-27 -Online5277 # added by Ludovic, 2026-10-27 (his top three by merged pull requests) diff --git a/.github/trusted-reviewers.txt b/.github/trusted-reviewers.txt new file mode 100644 index 000000000..550c528cc --- /dev/null +++ b/.github/trusted-reviewers.txt @@ -0,0 +1,8 @@ +# Trusted reviewers: one list for two things (docs/release-flow.md "Trusted reviewers"). +# - `/nightly 2640 2642` picks the pull requests the Nightly holds (tools/ci/nightly_set.py); +# - `/close`, `/reopen`, `/label`, `/unlabel` triage issues and pull requests (tools/ci/triage_command.py). +# Ludovic is always allowed and isn't listed. One GitHub login per line, with who added it and when. Removing a +# line revokes that login at once. A line with only `paused` stops both for every reviewer (Ludovic's still work). +kacpherek # added by Ludovic, 2026-10-27 +rdbtCVS # added by Ludovic, 2026-10-27 +Online5277 # added by Ludovic, 2026-10-27 (his top three by merged pull requests) diff --git a/.github/workflows/nightly-command.yml b/.github/workflows/nightly-command.yml index 340988d93..aef5c957b 100644 --- a/.github/workflows/nightly-command.yml +++ b/.github/workflows/nightly-command.yml @@ -1,5 +1,5 @@ name: nightly command -# `/nightly …` comments: the trusted reviewers in .github/nightly-reviewers.txt (and Ludovic) pick the pull requests +# `/nightly …` comments: the trusted reviewers in .github/trusted-reviewers.txt (and Ludovic) pick the pull requests # the Nightly holds (docs/release-flow.md "Nightly channel", tools/ci/nightly_set.py). This job only checks who asked, # saves the set on the nightly-state branch, starts `nightly build` and answers in the thread. # @@ -33,7 +33,7 @@ jobs: persist-credentials: false sparse-checkout: | .github/CODEOWNERS - .github/nightly-reviewers.txt + .github/trusted-reviewers.txt tools/ci/nightly_set.py sparse-checkout-cone-mode: false - name: Run the command diff --git a/.github/workflows/triage-command.yml b/.github/workflows/triage-command.yml new file mode 100644 index 000000000..938bbc337 --- /dev/null +++ b/.github/workflows/triage-command.yml @@ -0,0 +1,48 @@ +name: triage command +# `/close`, `/reopen`, `/label`, `/unlabel` comments: the trusted reviewers in .github/trusted-reviewers.txt (and +# Ludovic) triage issues and pull requests without any repository role (docs/release-flow.md "Trusted reviewers", +# tools/ci/triage_command.py). +# +# Why no pull request's code runs here, though the token can write: +# - `issue_comment` always runs this file from main, whoever comments and wherever. +# - It checks out main's script and list only, never a pull request; it reads threads through the API. +# - The comment's text and author reach the script as env vars, never in a shell line. The token stays in the step. +on: + issue_comment: + types: [created] +permissions: + contents: read +jobs: + command: + # Every other comment skips here, before a runner starts. + if: >- + github.event.comment.user.type != 'Bot' && ( + startsWith(github.event.comment.body, '/close') || + startsWith(github.event.comment.body, '/reopen') || + startsWith(github.event.comment.body, '/label') || + startsWith(github.event.comment.body, '/unlabel')) + runs-on: ubuntu-latest + timeout-minutes: 5 + permissions: + contents: read + issues: write + pull-requests: write + steps: + - uses: actions/checkout@v4 + with: + ref: main + persist-credentials: false + sparse-checkout: | + .github/trusted-reviewers.txt + tools/ci/nightly_set.py + tools/ci/triage_command.py + sparse-checkout-cone-mode: false + - name: Run the command + env: + GH_TOKEN: ${{ github.token }} + BODY: ${{ github.event.comment.body }} + AUTHOR: ${{ github.event.comment.user.login }} + ISSUE: ${{ github.event.issue.number }} + REPO: ${{ github.repository }} + COMMENT_URL: ${{ github.event.comment.html_url }} + run: python3 tools/ci/triage_command.py command diff --git a/docs/release-flow.md b/docs/release-flow.md index 09565bd2e..feadaa0a1 100644 --- a/docs/release-flow.md +++ b/docs/release-flow.md @@ -420,10 +420,36 @@ than main's head and holds something main lacks, otherwise main (`tools/ci/night new publishes nothing. A Nightly can include pull requests not reviewed yet: that is what it is for, playing them before the gate. -### Trusted reviewers pick the pull requests +### Trusted reviewers + +One list, `.github/trusted-reviewers.txt`, governs two things for the people on it (kacpherek, rdbtCVS and +Online5277 since 2026-10-27) and for Ludovic, with no repository role: `/nightly` (below) and triage by comment. + +```text +/close closes an issue as completed; a pull request is closed without merging +/close not planned closes an issue as not planned +/close duplicate of #123 comments "Duplicate of #123", closes as a duplicate +/reopen +/label bug, good first issue existing labels only; never creates one +/unlabel bug +``` + +- **Where.** On the first line of a comment on the issue or pull request (`.github/workflows/triage-command.yml`, + `tools/ci/triage_command.py`). The workflow answers with one comment, `🤖 Triage: , on behalf of @login`, + linking the comment that asked; a refusal answers too. +- **Refused.** Any label with `release` in its name (`release-now`, `release-blocker`, `skip-release`) and + `full-parity`; anything on Ludovic's own issues and pull requests; a merged pull request; a locked thread; more + than 60 actions per reviewer in 24 hours (counted from the workflow's own comments). +- **Safety.** Same as `/nightly`: main's copy of the workflow runs, no pull request's code is checked out or run, + the comment reaches the script as env vars, and the token has `issues` and `pull-requests` write only. +- **Ludovic stays in charge.** A one-line pull request removing a login from the list revokes it as soon as it merges + (the file is his under CODEOWNERS). A line `paused` stops `/nightly` and the triage commands for every reviewer; + his own still work. + +### Trusted reviewers pick the Nightly's pull requests The Nightly is where contributors test pull requests before the gate. The trusted reviewers listed in -`.github/nightly-reviewers.txt` (kacpherek, rdbtCVS and Online5277 since 2026-10-27) and Ludovic pick them with a +`.github/trusted-reviewers.txt` (kacpherek, rdbtCVS and Online5277 since 2026-10-27) and Ludovic pick them with a comment on any issue or pull request (`.github/workflows/nightly-command.yml`, `tools/ci/nightly_set.py`): ```text @@ -458,9 +484,9 @@ comment on any issue or pull request (`.github/workflows/nightly-command.yml`, ` - **Ludovic stays in charge.** - Ludovic's `/nightly clear` or `/nightly remove` always applies. A pull request he removed can only come back when he adds it. - - A one-line pull request removing a login from `.github/nightly-reviewers.txt` revokes it as soon as it merges + - A one-line pull request removing a login from `.github/trusted-reviewers.txt` revokes it as soon as it merges (the file is his under CODEOWNERS). - - A line `paused` in that file stops every reviewer's `/nightly`; his own still work. + - A line `paused` in that file stops every reviewer's `/nightly` (and triage commands); his own still work. - Main, the gate and releases don't change: picks reach only players who turned Nightly on. - **Jobs.** `pick` chooses or assembles the commit and writes the notes (each pull request in it with its title, diff --git a/tests/test_triage_command.py b/tests/test_triage_command.py new file mode 100644 index 000000000..2dbf14592 --- /dev/null +++ b/tests/test_triage_command.py @@ -0,0 +1,239 @@ +import unittest +from datetime import datetime, timezone +from pathlib import Path + +from tools.ci import nightly_set as ns +from tools.ci import triage_command as tc + +ROOT = Path(__file__).resolve().parents[1] +NOW = datetime(2026, 10, 28, 12, tzinfo=timezone.utc) +URL = "https://github.com/ludovic111/horizon/issues/5#issuecomment-1" +LIST = ns.read_reviewers("kacpherek\nrdbtCVS\n") + + +def thread(state="open", user="dev", labels=("bug",), pr=False, merged=False, locked=False): + t = {"state": state, "user": {"login": user}, "labels": [{"name": n} for n in labels], "locked": locked} + if pr: + t["pull_request"] = {"merged_at": "2026-10-27T00:00:00Z" if merged else None} + return t + + +class Fake: + def __init__(self, threads=None, labels=("bug", "good first issue", "release-now", "skip-release"), past=()): + self.threads = {5: thread()} if threads is None else threads + self.labels, self.past, self.calls = list(labels), list(past), [] + + def issue(self, n): + return self.threads.get(n) + + def label(self, name): + return next((l for l in self.labels if l.lower() == name.lower()), None) + + def add_labels(self, n, names): + self.calls.append(("add", n, names)) + + def remove_label(self, n, name): + self.calls.append(("remove", n, name)) + + def close(self, n, reason): + self.calls.append(("close", n, reason)) + + def reopen(self, n): + self.calls.append(("reopen", n)) + + def comment(self, n, text): + self.calls.append(("comment", n, text)) + + def recent_comments(self, since): + return self.past + + +def do(text, api=None, login="kacpherek", reviewers=LIST, n=5): + api = api or Fake() + return tc.run(api, tc.parse(text), login, n, URL, reviewers, NOW), api + + +class ParseTests(unittest.TestCase): + def test_commands_and_case(self): + self.assertEqual(tc.parse("/close"), tc.Command("close", "completed")) + self.assertEqual(tc.parse(" /CLOSE Not Planned "), tc.Command("close", "not_planned")) + self.assertEqual(tc.parse("/close completed"), tc.Command("close", "completed")) + self.assertEqual(tc.parse("/close duplicate of #123"), tc.Command("close", "duplicate", 123)) + self.assertEqual(tc.parse("/Close duplicate of 7"), tc.Command("close", "duplicate", 7)) + self.assertEqual(tc.parse("/reopen"), tc.Command("reopen")) + self.assertEqual(tc.parse("/label bug, good first issue ,bug"), tc.Command("label", labels=("bug", "good first issue"))) + self.assertEqual(tc.parse("/unlabel bug"), tc.Command("unlabel", labels=("bug",))) + + def test_first_line_only(self): + self.assertEqual(tc.parse("/close\n/label release-now"), tc.Command("close", "completed")) + self.assertIsNone(tc.parse("thanks\n/close")) + self.assertEqual(tc.parse("\n\n/reopen\nwhy"), tc.Command("reopen")) + + def test_not_commands(self): + for text in ("", "hello", "/nightly 5", "/closed", "/labels bug", "/closer", "close", "/unlabeled x"): + self.assertIsNone(tc.parse(text), text) + + def test_malformed(self): + for text in ("/close maybe", "/close duplicate of", "/reopen now", "/label", "/label ,", "/unlabel a, b", + "/label " + ",".join(str(i) for i in range(11))): + with self.assertRaises(tc.Refused, msg=text): + tc.parse(text) + + def test_quoting_is_safe(self): + with self.assertRaises(tc.Refused) as e: + tc.parse("/close @ludovic111 [x](http://evil)") + self.assertNotIn("@", str(e.exception)) + self.assertNotIn("](", str(e.exception)) + + +class AllowTests(unittest.TestCase): + def test_listed_and_ludovic(self): + do("/close", login="RDBTcvs") + do("/close", login="ludovic111") + + def test_stranger_refused(self): + with self.assertRaisesRegex(tc.Refused, "Only Ludovic"): + do("/close", login="someone") + + def test_paused(self): + paused = ns.read_reviewers("kacpherek\npaused\n") + with self.assertRaisesRegex(tc.Refused, "paused"): + do("/close", reviewers=paused) + do("/close", reviewers=paused, login="ludovic111") + + def test_the_repos_list_is_the_nightlys(self): + self.assertEqual(ns.REVIEWERS, ".github/trusted-reviewers.txt") + listed = ns.read_reviewers((ROOT / ns.REVIEWERS).read_text()) + self.assertEqual(listed.logins, {"kacpherek", "rdbtcvs", "online5277"}) + self.assertFalse(listed.paused) + + +class ActionTests(unittest.TestCase): + def test_close_issue(self): + text, api = do("/close not planned") + self.assertEqual(api.calls, [("close", 5, "not_planned")]) + self.assertIn("on behalf of @kacpherek", text) + self.assertIn(URL, text) + self.assertTrue(text.startswith("🤖 Triage: ")) + + def test_close_pr_has_no_reason(self): + api = Fake({5: thread(pr=True)}) + text, _ = do("/close", api) + self.assertEqual(api.calls, [("close", 5, None)]) + self.assertIn("without merging", text) + + def test_duplicate(self): + api = Fake({5: thread(), 9: thread()}) + text, _ = do("/close duplicate of #9", api) + self.assertEqual(api.calls, [("comment", 5, "Duplicate of #9"), ("close", 5, "duplicate")]) + self.assertIn("#9", text) + + def test_duplicate_of_missing_or_itself(self): + with self.assertRaisesRegex(tc.Refused, "no #9"): + do("/close duplicate of #9") + with self.assertRaisesRegex(tc.Refused, "itself"): + do("/close duplicate of #5") + + def test_reopen(self): + _, api = do("/reopen", Fake({5: thread("closed")})) + self.assertEqual(api.calls, [("reopen", 5)]) + with self.assertRaisesRegex(tc.Refused, "already open"): + do("/reopen") + with self.assertRaisesRegex(tc.Refused, "already closed"): + do("/close", Fake({5: thread("closed")})) + + def test_label_uses_the_real_name_and_skips_present(self): + _, api = do("/label Good First Issue, BUG") + self.assertEqual(api.calls, [("add", 5, ["good first issue"])]) + with self.assertRaisesRegex(tc.Refused, "already has"): + do("/label bug") + + def test_label_must_exist(self): + with self.assertRaisesRegex(tc.Refused, "no label"): + do("/label nonsense") + + def test_unlabel(self): + _, api = do("/unlabel BUG") + self.assertEqual(api.calls, [("remove", 5, "bug")]) + with self.assertRaisesRegex(tc.Refused, "doesn't have"): + do("/unlabel good first issue") + + +class RefusalTests(unittest.TestCase): + def test_release_and_parity_labels(self): + for name in ("release-now", "Release-Blocker", "skip-release", "full-parity", "prerelease"): + for verb in ("/label", "/unlabel"): + with self.assertRaisesRegex(tc.Refused, "release or parity", msg=name): + do(f"{verb} {name}", Fake(labels=(name,))) + with self.assertRaises(tc.Refused): + do("/label bug, release-now") + + def test_ludovics_threads(self): + for text in ("/close", "/label bug", "/unlabel bug", "/reopen"): + for t in (thread(user="ludovic111", state="closed" if text == "/reopen" else "open"), + thread(user="Ludovic111", pr=True)): + with self.assertRaisesRegex(tc.Refused, "Ludovic's"): + do(text, Fake({5: t})) + + def test_merged_pr(self): + for text in ("/close", "/reopen", "/label bug", "/unlabel bug"): + with self.assertRaisesRegex(tc.Refused, "merged"): + do(text, Fake({5: thread("closed", pr=True, merged=True)})) + + def test_locked(self): + for text in ("/close", "/label good first issue", "/unlabel bug"): + with self.assertRaisesRegex(tc.Refused, "locked"): + do(text, Fake({5: thread(locked=True)})) + + def test_missing_thread(self): + with self.assertRaisesRegex(tc.Refused, "no such"): + do("/close", Fake({})) + + def test_nothing_written_on_refusal(self): + api = Fake({5: thread(user="ludovic111")}) + with self.assertRaises(tc.Refused): + do("/close", api) + self.assertEqual(api.calls, []) + + +def past(login, n, who="github-actions[bot]"): + return [{"user": who, "body": f"🤖 Triage: closed as completed, on behalf of @{login} ([their comment](u))."} + for _ in range(n)] + + +class LimitTests(unittest.TestCase): + def test_sixty_a_day(self): + with self.assertRaisesRegex(tc.Refused, "60"): + do("/close", Fake(past=past("kacpherek", 60))) + do("/close", Fake(past=past("kacpherek", 59))) + + def test_other_reviewers_and_forged_comments_dont_count(self): + do("/close", Fake(past=past("rdbtcvs", 80))) + do("/close", Fake(past=past("kacpherek", 80, who="someone"))) + + def test_refusals_dont_count(self): + refusals = [{"user": "github-actions[bot]", "body": "🤖 Triage: refused, nope (asked by @kacpherek)"}] * 70 + do("/close", Fake(past=refusals)) + + def test_counts_case_insensitively(self): + with self.assertRaises(tc.Refused): + do("/close", Fake(past=past("kacpherek", 60)), login="Kacpherek") + + def test_ludovic_is_unlimited(self): + do("/close", Fake(past=past("ludovic111", 100)), login="ludovic111") + + +class WorkflowTests(unittest.TestCase): + def test_workflow_is_safe(self): + text = (ROOT / ".github/workflows/triage-command.yml").read_text() + run_lines = [l for l in text.splitlines() if l.strip().startswith("run:")] + self.assertEqual(run_lines, [" run: python3 tools/ci/triage_command.py command"]) + self.assertIn("persist-credentials: false", text) + self.assertNotIn("pull_request_target", text) + for perm in ("issues: write", "pull-requests: write", "contents: read"): + self.assertIn(perm, text) + self.assertNotIn("contents: write", text) + + +if __name__ == "__main__": + unittest.main() diff --git a/tools/ci/nightly_set.py b/tools/ci/nightly_set.py index a192993d4..8122a8d1c 100644 --- a/tools/ci/nightly_set.py +++ b/tools/ci/nightly_set.py @@ -4,7 +4,7 @@ nightly_set.py command one `/nightly …` comment (nightly-command.yml): checks who asked, updates the set, starts the build and answers in the thread -A comment by Ludovic or by a login in .github/nightly-reviewers.txt, on any issue or pull request: +A comment by Ludovic or by a login in .github/trusted-reviewers.txt, on any issue or pull request: /nightly 2640 2642 the set becomes these pull requests, merged onto main in this order; builds now /nightly add 2650 adds one, or takes its newest head again; builds now @@ -35,7 +35,7 @@ from pathlib import Path from typing import Callable OWNER = "ludovic111" -REVIEWERS = ".github/nightly-reviewers.txt" +REVIEWERS = ".github/trusted-reviewers.txt" CODEOWNERS = ".github/CODEOWNERS" # What CODEOWNERS guards today, refused even if the file moved: what builds, signs and checks releases. ALWAYS_GUARDED = ["/.github/", "/tools/ci/", "/crates/horizon-release-sign/", "/crates/horizon-server/src/update.rs", diff --git a/tools/ci/triage_command.py b/tools/ci/triage_command.py new file mode 100644 index 000000000..6639bd8fc --- /dev/null +++ b/tools/ci/triage_command.py @@ -0,0 +1,270 @@ +#!/usr/bin/env python3 +"""Trusted reviewers triage issues and pull requests with comment commands (docs/release-flow.md "Trusted reviewers"). + + triage_command.py command one comment (triage-command.yml): checks who asked, acts, answers in the thread + +A comment by Ludovic or by a login in .github/trusted-reviewers.txt, on the first line: + + /close [completed|not planned] closes an issue (a pull request: closes it without merging) + /close duplicate of #123 comments "Duplicate of #123" and closes it as a duplicate + /reopen + /label bug, good first issue existing labels only; never creates one + /unlabel bug + +Refused with a one-line answer: a label with `release` in it or `full-parity`; anything by Ludovic (his issues and +pull requests); a merged pull request; a locked thread; more than 60 actions per reviewer in 24 hours. No code of any +pull request is read or run: only the comment's text, its author and the API's answers, which reach this script as +env vars. +""" +from __future__ import annotations + +import json +import os +import re +import subprocess +import sys +from dataclasses import dataclass +from datetime import datetime, timedelta, timezone +from pathlib import Path +from typing import Callable + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +import nightly_set as ns # noqa: E402 (the same list, owner and paused rule as /nightly) + +MAX_PER_DAY = 60 +PREFIX = "🤖 Triage: " +COMMANDS = ("close", "reopen", "label", "unlabel") +REASONS = {"completed": "completed", "not planned": "not_planned", "not_planned": "not_planned"} +DUPLICATE = re.compile(r"^(?:as\s+)?(?:a\s+)?duplicate\s+of\s+#?(\d{1,7})$", re.I) +USAGE = ("Use `/close`, `/close not planned`, `/close duplicate of #123`, `/reopen`, `/label bug, good first issue` " + "or `/unlabel bug`.") + + +class Refused(Exception): + """A command that changes nothing; its text is the answer.""" + + +@dataclass +class Command: + verb: str # close, reopen, label, unlabel + reason: str | None = None # close: completed, not_planned, duplicate + original: int | None = None # close duplicate of #N + labels: tuple[str, ...] = () + + +def safe(text: str) -> str: + """Text of a comment, fit to quote back: no markdown, no mentions.""" + return re.sub(r"[^\w#:. -]", "", text)[:60].strip() or "?" + + +def parse(body: str) -> Command | None: + """The command on a comment's first line; None when it isn't one. Raises Refused when it is one, but wrong.""" + line = next((line.strip() for line in body.splitlines() if line.strip()), "") + m = re.match(r"^/(\w+)(?:\s+(.*))?$", line) + if not m or m.group(1).lower() not in COMMANDS: + return None + verb, rest = m.group(1).lower(), (m.group(2) or "").strip() + if verb == "reopen": + if rest: + raise Refused(f"`/reopen` takes no arguments. {USAGE}") + return Command("reopen") + if verb == "close": + if not rest: + return Command("close", "completed") + dup = DUPLICATE.match(rest) + if dup: + return Command("close", "duplicate", int(dup.group(1))) + reason = REASONS.get(" ".join(rest.lower().split())) + if not reason: + raise Refused(f"`{safe(rest)}` isn't a way to close. {USAGE}") + return Command("close", reason) + names = tuple(dict.fromkeys(n.strip() for n in rest.split(",") if n.strip())) + if not names: + raise Refused(f"`/{verb}` needs a label name. {USAGE}") + if verb == "unlabel" and len(names) > 1: + raise Refused(f"`/unlabel` takes one label. {USAGE}") + if len(names) > 10: + raise Refused("At most 10 labels at once.") + return Command(verb, labels=names) + + +def label_refusal(name: str) -> str | None: + low = name.lower() + if "release" in low or low == "full-parity": + return f"`{safe(name)}` is a release or parity label: only Ludovic's side touches those." + return None + + +def authorize(login: str, reviewers: ns.Reviewers) -> None: + """Ludovic always; a listed reviewer unless the list is paused; nobody else.""" + if ns.is_owner(login): + return + if login.lower() not in reviewers.logins: + raise Refused(f"Only Ludovic and the trusted reviewers listed in `{ns.REVIEWERS}` can triage this way.") + if reviewers.paused: + raise Refused(f"Triage commands are paused: Ludovic stopped them in `{ns.REVIEWERS}`.") + + +def target_refusal(issue: dict, cmd: Command, login: str) -> str | None: + """Why this thread can't be acted on (None when it can). `issue` is GitHub's issue object.""" + is_pr = "pull_request" in issue + kind = "pull request" if is_pr else "issue" + if not ns.is_owner(login) and ns.is_owner((issue.get("user") or {}).get("login", "")): + return f"This {kind} is Ludovic's: triage commands don't touch it." + if is_pr and (issue["pull_request"] or {}).get("merged_at"): + return "That pull request is already merged." + if issue.get("locked"): + return f"This {kind} is locked: triage commands don't act on it." + closed = issue.get("state") == "closed" + if cmd.verb == "close" and closed: + return f"This {kind} is already closed." + if cmd.verb == "reopen" and not closed: + return f"This {kind} is already open." + return None + + +def names_of(issue: dict) -> set[str]: + return {str(l.get("name", "") if isinstance(l, dict) else l).lower() for l in issue.get("labels", [])} + + +# --- GitHub ------------------------------------------------------------------------------------------------------ + + +def gh(*args: str, check: bool = True) -> str: + r = subprocess.run(["gh", *args], capture_output=True, text=True) + if check and r.returncode != 0: + raise RuntimeError(f"gh {args[0]} {args[1] if len(args) > 1 else ''}: {r.stderr.strip()[:300]}") + return r.stdout.strip() if r.returncode == 0 else "" + + +class Api: + """The few GitHub calls this needs; tests replace it.""" + + def __init__(self, repo: str): + self.repo = repo + + def issue(self, n: int) -> dict | None: + raw = gh("api", f"repos/{self.repo}/issues/{n}", check=False) + return json.loads(raw) if raw else None + + def label(self, name: str) -> str | None: + """The label's real name, or None when the repository has no such label.""" + raw = gh("api", f"repos/{self.repo}/labels/{name.replace('/', '%2F').replace(' ', '%20')}", check=False) + return json.loads(raw)["name"] if raw else None + + def add_labels(self, n: int, names: list[str]) -> None: + args = ["api", f"repos/{self.repo}/issues/{n}/labels"] + for name in names: + args += ["-f", f"labels[]={name}"] + gh(*args) + + def remove_label(self, n: int, name: str) -> None: + gh("api", "-X", "DELETE", f"repos/{self.repo}/issues/{n}/labels/{name.replace(' ', '%20')}") + + def close(self, n: int, reason: str | None) -> None: + args = ["api", "-X", "PATCH", f"repos/{self.repo}/issues/{n}", "-f", "state=closed"] + if reason: + args += ["-f", f"state_reason={reason}"] + gh(*args) + + def reopen(self, n: int) -> None: + gh("api", "-X", "PATCH", f"repos/{self.repo}/issues/{n}", "-f", "state=open") + + def comment(self, n: int, text: str) -> None: + gh("api", f"repos/{self.repo}/issues/{n}/comments", "-f", f"body={text}") + + def recent_comments(self, since: str) -> list[dict]: + """Comments of the whole repository since a time (ISO 8601), as {user, body}.""" + raw = gh("api", "--paginate", f"repos/{self.repo}/issues/comments?since={since}&per_page=100", "--jq", + '.[] | {user: .user.login, body: .body}') + return [json.loads(line) for line in raw.splitlines() if line.strip()] + + +def actions_by(api, login: str, now: datetime) -> int: + """Actions this workflow answered for `login` in the last 24 h, counted from its own comments.""" + since = (now - timedelta(hours=24)).strftime("%Y-%m-%dT%H:%M:%SZ") + tag = f"on behalf of @{login.lower()}" + return sum(1 for c in api.recent_comments(since) + if c["user"] == "github-actions[bot]" and c["body"].startswith(PREFIX) + and c["body"].split("\n", 1)[0].lower().count(tag)) + + +def say(action: str, login: str, url: str) -> str: + return f"{PREFIX}{action}, on behalf of @{login} ([their comment]({url}))." + + +def run(api, cmd: Command, login: str, number: int, url: str, reviewers: ns.Reviewers, now: datetime) -> str: + """Does the command; returns the comment to post. Raises Refused for a refusal.""" + authorize(login, reviewers) + for name in cmd.labels: + if (why := label_refusal(name)): + raise Refused(why) + issue = api.issue(number) + if issue is None: + raise Refused("There is no such issue or pull request.") + if (why := target_refusal(issue, cmd, login)): + raise Refused(why) + if cmd.original is not None: + if cmd.original == number: + raise Refused("An item cannot be a duplicate of itself.") + if api.issue(cmd.original) is None: + raise Refused(f"There is no #{cmd.original} in Horizon.") + if not ns.is_owner(login) and actions_by(api, login, now) >= MAX_PER_DAY: + raise Refused(f"You used your {MAX_PER_DAY} triage actions of the last 24 hours. Try again later.") + is_pr = "pull_request" in issue + if cmd.verb == "reopen": + api.reopen(number) + return say("reopened", login, url) + if cmd.verb == "close": + if cmd.reason == "duplicate": + api.comment(number, f"Duplicate of #{cmd.original}") + api.close(number, None if is_pr else "duplicate") + return say(f"closed as a duplicate of #{cmd.original}", login, url) + api.close(number, None if is_pr else cmd.reason) + how = "closed without merging" if is_pr else f"closed as {cmd.reason.replace('_', ' ')}" + return say(how, login, url) + have = names_of(issue) + real: list[str] = [] + for name in cmd.labels: + found = api.label(name) + if found is None: + raise Refused(f"There is no label `{safe(name)}` in Horizon: triage doesn't create new ones.") + if (why := label_refusal(found)): + raise Refused(why) + real.append(found) + if cmd.verb == "label": + new = [n for n in real if n.lower() not in have] + if not new: + raise Refused("It already has " + ("that label." if len(real) == 1 else "those labels.")) + api.add_labels(number, new) + return say("added " + ", ".join(f"`{n}`" for n in new), login, url) + name = real[0] + if name.lower() not in have: + raise Refused(f"It doesn't have `{name}`.") + api.remove_label(number, name) + return say(f"removed `{name}`", login, url) + + +def command() -> int: + body, login = os.environ["BODY"], os.environ["AUTHOR"] + number, url, repo = int(os.environ["ISSUE"]), os.environ.get("COMMENT_URL", ""), os.environ["REPO"] + api: Api = Api(repo) + try: + cmd = parse(body) + if cmd is None: + return 0 + reviewers = ns.read_reviewers(Path(ns.REVIEWERS).read_text()) + text = run(api, cmd, login, number, url, reviewers, datetime.now(timezone.utc)) + except Refused as e: + text = f"{PREFIX}refused, {e} (asked by @{safe(login)})" + except RuntimeError as e: + print(e, file=sys.stderr) + text = f"{PREFIX}GitHub refused that, nothing more was done (asked by @{safe(login)})." + api.comment(number, text) + return 0 + + +if __name__ == "__main__": + if sys.argv[1:] != ["command"]: + sys.exit(__doc__) + sys.exit(command()) From d2b0347777e42b39717ed568f6a2414a1fe46f21 Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Tue, 27 Oct 2026 21:28:04 +0100 Subject: [PATCH 10/11] Point links at the horizon-rust organization The repositories moved from ludovic111 to the horizon-rust organization. GitHub redirects repository URLs but not GitHub Pages, so the mod index moved to https://horizon-rust.github.io/horizon-mods/: the launcher and the game read it there. The launcher still accepts icons and files from the old addresses, which a mirror keeps serving for launchers released before the move. Release notes thanked ludovic111 once the repository's owner became the organization (verify failed on main): the maintainer is now named. Co-Authored-By: Claude Opus 5.5 --- AGENTS.md | 2 +- CONTRIBUTING.md | 2 +- README.md | 8 +- ROADMAP.md | 132 +++++++++--------- .../server-equal-mixed-2026-10-18/README.md | 2 +- .../server-four-way-2026-10-19/README.md | 2 +- benchmarks/server-mixed-2026-10-18/README.md | 2 +- crates/cargo-horizon-mod/src/main.rs | 2 +- crates/cargo-horizon-mod/src/registry.rs | 4 +- crates/horizon-client/src/moved_extras.rs | 2 +- crates/horizon-friends/src/reach.rs | 2 +- crates/horizon-mod-registry/README.md | 4 +- crates/horizon-mod-registry/src/lib.rs | 2 +- crates/horizon-mods/src/index.rs | 2 +- crates/horizon-mods/src/index/registry.rs | 2 +- .../horizon-mods/src/index/registry/tests.rs | 8 +- crates/horizon-mods/src/index/tests.rs | 2 +- crates/horizon-mods/tests/index/index-v1.json | 14 +- crates/horizon-port-pack/src/modrinth.rs | 2 +- crates/horizon-server/src/service.rs | 2 +- crates/horizon-server/src/update.rs | 2 +- crates/horizon-telemetry-server/README.md | 4 +- .../horizon-telemetry-server/src/classes.rs | 2 +- crates/horizon-telemetry-server/src/lib.rs | 2 +- .../horizon-telemetry-server/src/summary.rs | 2 +- .../tests/fixtures/benchmarks/README.md | 2 +- crates/horizon-telemetry-server/tests/hub.rs | 4 +- .../horizon-telemetry-server/tests/summary.rs | 2 +- docs/api/README.md | 2 +- docs/api/mod-index.md | 8 +- docs/api/mods.md | 2 +- docs/design-system.md | 2 +- docs/hosting.md | 16 +-- docs/how-horizon-is-built.md | 8 +- docs/microsoft-account.md | 2 +- docs/mod-browser.md | 2 +- docs/mods.md | 6 +- docs/release-flow.md | 4 +- docs/research-lab.md | 2 +- docs/resource-packs.md | 12 +- docs/server.md | 4 +- docs/surface-generation-benchmark.md | 2 +- docs/telemetry.md | 2 +- docs/version-ports.md | 6 +- docs/versioning.md | 4 +- launcher/README.md | 2 +- launcher/src/backend.rs | 4 +- launcher/src/browser/download.rs | 6 +- launcher/src/browser/horizon.rs | 8 +- launcher/src/browser/images.rs | 6 +- launcher/src/signed.rs | 2 +- packaging/PLAY.txt | 2 +- packaging/server/install.ps1 | 4 +- packaging/server/install.sh | 4 +- roadmap/README.md | 2 +- tests/test_release_train.py | 4 +- tests/test_roadmap.py | 4 +- tests/test_triage_command.py | 2 +- tools/ci/legacy_releases.py | 2 +- tools/ci/linux-runner.sh | 4 +- tools/ci/new_release_key.sh | 2 +- tools/ci/protect_pipeline.sh | 2 +- tools/ci/version-port-daily.sh | 2 +- tools/parity_main.py | 2 +- tools/release_train.py | 6 +- tools/remote.sh | 2 +- tools/roadmap.py | 6 +- tools/server_bench.py | 2 +- 68 files changed, 194 insertions(+), 188 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index e5561f7b5..ef232a1e2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -58,7 +58,7 @@ Game workspace (root `Cargo.toml`); `launcher/` and `crates/horizon-telemetry-se Other top-level folders: `tools/` (harnesses and dev scripts), `tests/` (Python unit tests: `python3 -m unittest discover -s tests`), `mods/horizon/src/test/java/dev/horizonlab/parity/` (Java oracles), -`docs/`, `.github/workflows/`. The website (playhorizon.dev) is the private ludovic111/horizon-site: its build +`docs/`, `.github/workflows/`. The website (playhorizon.dev) is the private horizon-rust/horizon-site: its build reads `README.md`, `launcher/links.json`, `docs/api/`, `roadmap/roadmap.json` and `crates/horizon-theme/tokens.css` from main. ## Build and test fast diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 03f3bd97b..42959f950 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -98,5 +98,5 @@ new pushes, we add it again. ## Talk to us -[Discord](https://discord.gg/HcTeMZxe5E) for questions and ideas, [issues](https://github.com/ludovic111/horizon/issues) +[Discord](https://discord.gg/HcTeMZxe5E) for questions and ideas, [issues](https://github.com/horizon-rust/horizon/issues) for bugs. If you want to take something on, say so in its issue so nobody else starts the same work. diff --git a/README.md b/README.md index ae85f7dbd..83a98975e 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@

- CI + CI Minecraft Java 26.3 Rust Vanilla parity 100% @@ -15,7 +15,7 @@ Website · Download · Documentation · - Release notes · + Release notes · Roadmap · Project status · Contributing @@ -29,7 +29,7 @@ Horizon is Minecraft: Java Edition 26.3 rewritten in Rust: a native game that re ## Download -Horizon is installed through **the Horizon launcher**. Get it from [playhorizon.dev](https://playhorizon.dev) (the Download button picks your system) or from [the launcher releases](https://github.com/ludovic111/horizon/releases?q=launcher-v&expanded=true), for Linux x86-64, macOS on Apple Silicon or Windows x64. The launcher installs and updates the game, prepares its files from your own copy of Minecraft, and updates itself. +Horizon is installed through **the Horizon launcher**. Get it from [playhorizon.dev](https://playhorizon.dev) (the Download button picks your system) or from [the launcher releases](https://github.com/horizon-rust/horizon/releases?q=launcher-v&expanded=true), for Linux x86-64, macOS on Apple Silicon or Windows x64. The launcher installs and updates the game, prepares its files from your own copy of Minecraft, and updates itself. **You need** a Microsoft account that owns Minecraft: Java Edition (the launcher signs in with it, as other launchers do; see [Microsoft account](docs/microsoft-account.md)); Minecraft: Java Edition 26.3, played once (the official launcher, Prism, MultiMC and other launchers all work); a Java 25 runtime, for the one-time preparation; and a GPU with Vulkan on Linux and Windows, or any Apple Silicon Mac. Step by step, with macOS's first-open prompt and the first launch: [Install and first launch](https://playhorizon.dev/docs/install). @@ -99,7 +99,7 @@ Horizon contains no game files and never downloads them. It builds its resources 2. **Server jar:** the 26.3 server jar, from the `downloads.server.url` in your launcher's `versions/26.3/26.3.json` (or [minecraft.net/download/server](https://www.minecraft.net/en-us/download/server) while 26.3 is the current release). Pass it with `--server-jar` or set `HORIZON_SERVER_JAR`. It is only needed the first time. ```sh -git clone https://github.com/ludovic111/horizon.git +git clone https://github.com/horizon-rust/horizon.git cd horizon cargo run --release -p horizon-prepare -- --prepare --server-jar ~/Downloads/server.jar # needs JDK 25 cargo run --release -p horizon-prepare -- sounds # optional: sounds from your launcher install diff --git a/ROADMAP.md b/ROADMAP.md index 9b82f4fac..eacc5e75d 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -32,7 +32,7 @@ Making Horizon faster than vanilla on every computer, with smooth camera movemen

Technical -Frame pacing at render distance 32 ([#678](https://github.com/ludovic111/horizon/issues/678)): long frames come from work competing with the render thread. In review: world generation workers build free structure starts instead of queueing them ([#1760](https://github.com/ludovic111/horizon/issues/1760)), the worker pool leaves one core as vanilla does ([#1778](https://github.com/ludovic111/horizon/issues/1778)), and the terrain vertex arena is read as storage where flat draws run ([#1742](https://github.com/ludovic111/horizon/issues/1742)). Still open: far terrain at 48 to 64 chunks ([#718](https://github.com/ludovic111/horizon/issues/718)) and CPU-bound fields of block entities ([#717](https://github.com/ludovic111/horizon/issues/717)). Every change shows before and after numbers from `tools/perf_bench.py` against vanilla 26.3 ([docs/benchmark.md](docs/benchmark.md)). +Frame pacing at render distance 32 ([#678](https://github.com/horizon-rust/horizon/issues/678)): long frames come from work competing with the render thread. In review: world generation workers build free structure starts instead of queueing them ([#1760](https://github.com/horizon-rust/horizon/issues/1760)), the worker pool leaves one core as vanilla does ([#1778](https://github.com/horizon-rust/horizon/issues/1778)), and the terrain vertex arena is read as storage where flat draws run ([#1742](https://github.com/horizon-rust/horizon/issues/1742)). Still open: far terrain at 48 to 64 chunks ([#718](https://github.com/horizon-rust/horizon/issues/718)) and CPU-bound fields of block entities ([#717](https://github.com/horizon-rust/horizon/issues/717)). Every change shows before and after numbers from `tools/perf_bench.py` against vanilla 26.3 ([docs/benchmark.md](docs/benchmark.md)).
@@ -42,7 +42,7 @@ Speeding up the code that reads and writes the blocks of the world, which almost
Technical -`PalettedContainer` and `PackedStorage` find an entry's word by multiply and shift instead of an integer division ([#1790](https://github.com/ludovic111/horizon/issues/1790), [#1794](https://github.com/ludovic111/horizon/issues/1794)); meshing looks up baked models by index, not by name ([#1747](https://github.com/ludovic111/horizon/issues/1747)). Each change keeps the paletted storage harnesses identical and shows its microbenchmark ([docs/performance/paletted-container-access-results.md](docs/performance/paletted-container-access-results.md)). +`PalettedContainer` and `PackedStorage` find an entry's word by multiply and shift instead of an integer division ([#1790](https://github.com/horizon-rust/horizon/issues/1790), [#1794](https://github.com/horizon-rust/horizon/issues/1794)); meshing looks up baked models by index, not by name ([#1747](https://github.com/horizon-rust/horizon/issues/1747)). Each change keeps the paletted storage harnesses identical and shows its microbenchmark ([docs/performance/paletted-container-access-results.md](docs/performance/paletted-container-access-results.md)).
@@ -54,7 +54,7 @@ Making the world-generation mods of popular modpacks (new structures, YUNG's dun
Technical -`horizon-port-pack` carries a pack's data-driven content over; structure mods that need code get a native port: YUNG's worldgen as written ([#1746](https://github.com/ludovic111/horizon/issues/1746)), Lithostitched's limited and guaranteed elements with pool and processor modifiers ([#1777](https://github.com/ludovic111/horizon/issues/1777)), its processors as the game's own types ([#1765](https://github.com/ludovic111/horizon/issues/1765)). Proved by the structure blocks and layout harnesses ([#1753](https://github.com/ludovic111/horizon/issues/1753), [#1757](https://github.com/ludovic111/horizon/issues/1757)). Mods whose Java code does more than world generation don't run ([docs/modpacks.md](docs/modpacks.md)). +`horizon-port-pack` carries a pack's data-driven content over; structure mods that need code get a native port: YUNG's worldgen as written ([#1746](https://github.com/horizon-rust/horizon/issues/1746)), Lithostitched's limited and guaranteed elements with pool and processor modifiers ([#1777](https://github.com/horizon-rust/horizon/issues/1777)), its processors as the game's own types ([#1765](https://github.com/horizon-rust/horizon/issues/1765)). Proved by the structure blocks and layout harnesses ([#1753](https://github.com/horizon-rust/horizon/issues/1753), [#1757](https://github.com/horizon-rust/horizon/issues/1757)). Mods whose Java code does more than world generation don't run ([docs/modpacks.md](docs/modpacks.md)).
@@ -66,7 +66,7 @@ When you play on a server, other players, mobs, items and menus look and behave
Technical -Client-of-a-server fixes in `game/remote*.rs` and `horizon-protocol`: mobs' aggressive and item-use flags ([#1802](https://github.com/ludovic111/horizon/issues/1802), [#1798](https://github.com/ludovic111/horizon/issues/1798)), ghost items after a remote menu ([#1795](https://github.com/ludovic111/horizon/issues/1795)), skins ([#1652](https://github.com/ludovic111/horizon/issues/1652)), cookies and transfer packets for proxy networks ([#1650](https://github.com/ludovic111/horizon/issues/1650)), firework boosts ([#1671](https://github.com/ludovic111/horizon/issues/1671)), living-entity attributes and simulation distance ([#1731](https://github.com/ludovic111/horizon/issues/1731)), styled item names ([#1702](https://github.com/ludovic111/horizon/issues/1702)), primed TNT between updates ([#1710](https://github.com/ludovic111/horizon/issues/1710)). +Client-of-a-server fixes in `game/remote*.rs` and `horizon-protocol`: mobs' aggressive and item-use flags ([#1802](https://github.com/horizon-rust/horizon/issues/1802), [#1798](https://github.com/horizon-rust/horizon/issues/1798)), ghost items after a remote menu ([#1795](https://github.com/horizon-rust/horizon/issues/1795)), skins ([#1652](https://github.com/horizon-rust/horizon/issues/1652)), cookies and transfer packets for proxy networks ([#1650](https://github.com/horizon-rust/horizon/issues/1650)), firework boosts ([#1671](https://github.com/horizon-rust/horizon/issues/1671)), living-entity attributes and simulation distance ([#1731](https://github.com/horizon-rust/horizon/issues/1731)), styled item names ([#1702](https://github.com/horizon-rust/horizon/issues/1702)), primed TNT between updates ([#1710](https://github.com/horizon-rust/horizon/issues/1710)).
@@ -76,7 +76,7 @@ Servers that show dialogs, such as the register and login screens of AuthMe, wil
Technical -26.3's dialog packets and model ([#1720](https://github.com/ludovic111/horizon/issues/1720)), the dialog screen with its buttons and actions ([#1734](https://github.com/ludovic111/horizon/issues/1734)), then text and boolean inputs ([#1735](https://github.com/ludovic111/horizon/issues/1735)). +26.3's dialog packets and model ([#1720](https://github.com/horizon-rust/horizon/issues/1720)), the dialog screen with its buttons and actions ([#1734](https://github.com/horizon-rust/horizon/issues/1734)), then text and boolean inputs ([#1735](https://github.com/horizon-rust/horizon/issues/1735)).
@@ -86,7 +86,7 @@ A /pregen command that builds an area of the world ahead of time, so players don
Technical -Generates, lights and saves an area before anyone walks there ([#1805](https://github.com/ludovic111/horizon/issues/1805), a contributor's pull request, in review). Useful on servers, and it moves the generation cost away from the first visit; the generation speed-ups are under 'Steady frames at long render distances'. +Generates, lights and saves an area before anyone walks there ([#1805](https://github.com/horizon-rust/horizon/issues/1805), a contributor's pull request, in review). Useful on servers, and it moves the generation cost away from the first visit; the generation speed-ups are under 'Steady frames at long render distances'.
@@ -98,7 +98,7 @@ One place for mods, modpacks and resource packs made for Horizon: browse them on
Technical -Merged: the registry index (schema 1, `.hpack`, checks before install, [#1634](https://github.com/ludovic111/horizon/issues/1634)), `cargo horizon-mod check` ([#1642](https://github.com/ludovic111/horizon/issues/1642)) and the submission service (`crates/horizon-mod-registry`, [#1659](https://github.com/ludovic111/horizon/issues/1659)). In review: the website's /mods ([#1596](https://github.com/ludovic111/horizon/issues/1596)) and /mods/submit ([#1635](https://github.com/ludovic111/horizon/issues/1635)), and in the launcher the registry as a source ([#1636](https://github.com/ludovic111/horizon/issues/1636)), install, enable and takedowns ([#1637](https://github.com/ludovic111/horizon/issues/1637)), the Mods page ([#1638](https://github.com/ludovic111/horizon/issues/1638)) and modpacks as their own profiles ([#1640](https://github.com/ludovic111/horizon/issues/1640)). +Merged: the registry index (schema 1, `.hpack`, checks before install, [#1634](https://github.com/horizon-rust/horizon/issues/1634)), `cargo horizon-mod check` ([#1642](https://github.com/horizon-rust/horizon/issues/1642)) and the submission service (`crates/horizon-mod-registry`, [#1659](https://github.com/horizon-rust/horizon/issues/1659)). In review: the website's /mods ([#1596](https://github.com/horizon-rust/horizon/issues/1596)) and /mods/submit ([#1635](https://github.com/horizon-rust/horizon/issues/1635)), and in the launcher the registry as a source ([#1636](https://github.com/horizon-rust/horizon/issues/1636)), install, enable and takedowns ([#1637](https://github.com/horizon-rust/horizon/issues/1637)), the Mods page ([#1638](https://github.com/horizon-rust/horizon/issues/1638)) and modpacks as their own profiles ([#1640](https://github.com/horizon-rust/horizon/issues/1640)). More: [docs/mods.md](docs/mods.md) @@ -110,7 +110,7 @@ Mods that run on the server side of a world, so a dedicated server or a LAN worl
Technical -API 0.3, experimental first ([#1833](https://github.com/ludovic111/horizon/issues/1833), in review): the same sandboxed component runs on the server thread and the dedicated server, with world events (block broken or placed, entity spawned or killed, player joined or left), game rules and server commands with typed arguments. The world, item and entity interfaces come after (see 'Mods that read and change the world'). [docs/api/mods.md](docs/api/mods.md), [docs/mods.md](docs/mods.md). +API 0.3, experimental first ([#1833](https://github.com/horizon-rust/horizon/issues/1833), in review): the same sandboxed component runs on the server thread and the dedicated server, with world events (block broken or placed, entity spawned or killed, player joined or left), game rules and server commands with typed arguments. The world, item and entity interfaces come after (see 'Mods that read and change the world'). [docs/api/mods.md](docs/api/mods.md), [docs/mods.md](docs/mods.md).
@@ -120,7 +120,7 @@ Mods will be able to open their own screens and settings pages and react to keys
Technical -Capability `ui` is in review ([#1864](https://github.com/ludovic111/horizon/issues/1864)): mod-owned screens and a settings page under Options > Mods, built from vanilla's widgets. Still to design: `input` (an item's use, key binds, the crosshair target), `render` (a budgeted draw list on the native shader API) and `world` (changing blocks). Orbital Laser is the acceptance test: it needs all four today through its author's fork (see 'Orbital Laser on the normal game'). +Capability `ui` is in review ([#1864](https://github.com/horizon-rust/horizon/issues/1864)): mod-owned screens and a settings page under Options > Mods, built from vanilla's widgets. Still to design: `input` (an item's use, key binds, the crosshair target), `render` (a budgeted draw list on the native shader API) and `world` (changing blocks). Orbital Laser is the acceptance test: it needs all four today through its author's fork (see 'Orbital Laser on the normal game'). More: [docs/mods.md](docs/mods.md) @@ -132,7 +132,7 @@ Better tools for mod makers: a test runner that needs no game window, templates
Technical -`cargo horizon-mod test` runs a mod's test scripts against a fake game snapshot ([#1816](https://github.com/ludovic111/horizon/issues/1816)) and, for server mods, scripted server events ([#1837](https://github.com/ludovic111/horizon/issues/1837)); the content template and the guides are merged ([#1859](https://github.com/ludovic111/horizon/issues/1859), [#1810](https://github.com/ludovic111/horizon/issues/1810), [docs/api/stability.md](docs/api/stability.md)). Left: templates for hud, server and machine mods, typed wrappers in the SDK, a frozen 0.1 compatibility mod that every runtime must load, a CI check that fails when a stable reference entry is removed without a new major version, and the SDK on crates.io once the API is stable. +`cargo horizon-mod test` runs a mod's test scripts against a fake game snapshot ([#1816](https://github.com/horizon-rust/horizon/issues/1816)) and, for server mods, scripted server events ([#1837](https://github.com/horizon-rust/horizon/issues/1837)); the content template and the guides are merged ([#1859](https://github.com/horizon-rust/horizon/issues/1859), [#1810](https://github.com/horizon-rust/horizon/issues/1810), [docs/api/stability.md](docs/api/stability.md)). Left: templates for hud, server and machine mods, typed wrappers in the SDK, a frozen 0.1 compatibility mod that every runtime must load, a CI check that fails when a stable reference entry is removed without a new major version, and the SDK on crates.io once the API is stable. More: [https://playhorizon.dev/docs/test-a-mod](https://playhorizon.dev/docs/test-a-mod) @@ -146,7 +146,7 @@ Single player now runs a small server in the background, as vanilla does. We are
Technical -Since [#1514](https://github.com/ludovic111/horizon/issues/1514) single player runs on the server thread (`game/integrated.rs`) and the window joins it as a client; `--in-frame` keeps the old path. The open `[server-thread]` issues list the gaps. In review: a tool that changes a block ends the click ([#1797](https://github.com/ludovic111/horizon/issues/1797)), potions keep their potion over the connection ([#1796](https://github.com/ludovic111/horizon/issues/1796)), mobs' aggression and arm swings ([#1802](https://github.com/ludovic111/horizon/issues/1802)). [docs/server-levels.md](docs/server-levels.md). +Since [#1514](https://github.com/horizon-rust/horizon/issues/1514) single player runs on the server thread (`game/integrated.rs`) and the window joins it as a client; `--in-frame` keeps the old path. The open `[server-thread]` issues list the gaps. In review: a tool that changes a block ends the click ([#1797](https://github.com/horizon-rust/horizon/issues/1797)), potions keep their potion over the connection ([#1796](https://github.com/horizon-rust/horizon/issues/1796)), mobs' aggression and arm swings ([#1802](https://github.com/horizon-rust/horizon/issues/1802)). [docs/server-levels.md](docs/server-levels.md).
@@ -156,7 +156,7 @@ Item names, container titles and server messages follow the language you pick, a
Technical -Translatable components resolved through the selected language for items, containers and server text ([#1806](https://github.com/ludovic111/horizon/issues/1806)), on top of the bundled languages the prepared resources carry ([#1594](https://github.com/ludovic111/horizon/issues/1594)). Left: the client's own screens ([#1672](https://github.com/ludovic111/horizon/issues/1672)) and the main menu with zh_cn ([#1774](https://github.com/ludovic111/horizon/issues/1774)). +Translatable components resolved through the selected language for items, containers and server text ([#1806](https://github.com/horizon-rust/horizon/issues/1806)), on top of the bundled languages the prepared resources carry ([#1594](https://github.com/horizon-rust/horizon/issues/1594)). Left: the client's own screens ([#1672](https://github.com/horizon-rust/horizon/issues/1672)) and the main menu with zh_cn ([#1774](https://github.com/horizon-rust/horizon/issues/1774)).
@@ -166,9 +166,9 @@ After you throw an ender pearl, its slot should show the cooldown sweeping away,
Technical -Vanilla draws `ItemCooldowns`' percent as a white overlay over the slot (`GuiGraphicsExtractor.itemDecorations` and `itemCooldown`) in the hotbar and in inventories. Issue [#1763](https://github.com/ludovic111/horizon/issues/1763). +Vanilla draws `ItemCooldowns`' percent as a white overlay over the slot (`GuiGraphicsExtractor.itemDecorations` and `itemCooldown`) in the hotbar and in inventories. Issue [#1763](https://github.com/horizon-rust/horizon/issues/1763). -More: [#1933](https://github.com/ludovic111/horizon/issues/1933) +More: [#1933](https://github.com/horizon-rust/horizon/issues/1933)
@@ -178,9 +178,9 @@ The Hidden and Commands Only chat settings should hide chat, and team prefixes s
Technical -Vanilla checks `ChatVisiblity` before it delivers chat and system messages ([#1376](https://github.com/ludovic111/horizon/issues/1376)), and chat uses the team-formatted display name ([#1378](https://github.com/ludovic111/horizon/issues/1378)). Both issues have exact steps to reproduce. +Vanilla checks `ChatVisiblity` before it delivers chat and system messages ([#1376](https://github.com/horizon-rust/horizon/issues/1376)), and chat uses the team-formatted display name ([#1378](https://github.com/horizon-rust/horizon/issues/1378)). Both issues have exact steps to reproduce. -More: [#1932](https://github.com/ludovic111/horizon/issues/1932) · [#1841](https://github.com/ludovic111/horizon/issues/1841) +More: [#1932](https://github.com/horizon-rust/horizon/issues/1932) · [#1841](https://github.com/horizon-rust/horizon/issues/1841)
@@ -190,9 +190,9 @@ The mouse pointer should turn into a pointing hand over menu buttons, as in vani
Technical -26.3's `AbstractWidget` asks for a cursor from `CursorTypes` when it is hovered; winit's `CursorIcon::Pointer` gives the same shape. Issue [#1347](https://github.com/ludovic111/horizon/issues/1347). +26.3's `AbstractWidget` asks for a cursor from `CursorTypes` when it is hovered; winit's `CursorIcon::Pointer` gives the same shape. Issue [#1347](https://github.com/horizon-rust/horizon/issues/1347). -More: [#1897](https://github.com/ludovic111/horizon/issues/1897) +More: [#1897](https://github.com/horizon-rust/horizon/issues/1897)
@@ -202,9 +202,9 @@ Ctrl+Backspace should delete a whole word in the creative search, and every list
Technical -`EditBox` deletes by word with Ctrl ([#1764](https://github.com/ludovic111/horizon/issues/1764)); the Game Rules and Statistics lists' scroll bars can't be dragged ([#1782](https://github.com/ludovic111/horizon/issues/1782), after [#978](https://github.com/ludovic111/horizon/issues/978)). +`EditBox` deletes by word with Ctrl ([#1764](https://github.com/horizon-rust/horizon/issues/1764)); the Game Rules and Statistics lists' scroll bars can't be dragged ([#1782](https://github.com/horizon-rust/horizon/issues/1782), after [#978](https://github.com/horizon-rust/horizon/issues/978)). -More: [#1884](https://github.com/ludovic111/horizon/issues/1884) · [#1931](https://github.com/ludovic111/horizon/issues/1931) +More: [#1884](https://github.com/horizon-rust/horizon/issues/1884) · [#1931](https://github.com/horizon-rust/horizon/issues/1931)
@@ -214,9 +214,9 @@ Chickens should flap their wings while they fall, not stand still in the air.
Technical -Vanilla's `Chicken.aiStep` updates `flap` and `flapSpeed` when the chicken isn't on the ground, and the model's wings follow them. Issue [#1706](https://github.com/ludovic111/horizon/issues/1706). +Vanilla's `Chicken.aiStep` updates `flap` and `flapSpeed` when the chicken isn't on the ground, and the model's wings follow them. Issue [#1706](https://github.com/horizon-rust/horizon/issues/1706). -More: [#1892](https://github.com/ludovic111/horizon/issues/1892) +More: [#1892](https://github.com/horizon-rust/horizon/issues/1892)
@@ -228,9 +228,9 @@ Shader packs were removed and are being rebuilt from scratch. They come back, of
Technical -A clean-room rewrite in `horizon-shaderpack`, from the packs' public format documentation only: reading packs, the preprocessor and `.properties` files are merged ([#1584](https://github.com/ludovic111/horizon/issues/1584), [#1585](https://github.com/ludovic111/horizon/issues/1585), [#1586](https://github.com/ludovic111/horizon/issues/1586)); translating programs to WGSL through naga, buffers, uniforms and the terrain, entity, sky, weather and hand stages are in review ([#1698](https://github.com/ludovic111/horizon/issues/1698) to [#1801](https://github.com/ludovic111/horizon/issues/1801)). +A clean-room rewrite in `horizon-shaderpack`, from the packs' public format documentation only: reading packs, the preprocessor and `.properties` files are merged ([#1584](https://github.com/horizon-rust/horizon/issues/1584), [#1585](https://github.com/horizon-rust/horizon/issues/1585), [#1586](https://github.com/horizon-rust/horizon/issues/1586)); translating programs to WGSL through naga, buffers, uniforms and the terrain, entity, sky, weather and hand stages are in review ([#1698](https://github.com/horizon-rust/horizon/issues/1698) to [#1801](https://github.com/horizon-rust/horizon/issues/1801)). -More: [#1561](https://github.com/ludovic111/horizon/issues/1561) · [#1771](https://github.com/ludovic111/horizon/issues/1771) · [#1786](https://github.com/ludovic111/horizon/issues/1786) +More: [#1561](https://github.com/horizon-rust/horizon/issues/1561) · [#1771](https://github.com/horizon-rust/horizon/issues/1771) · [#1786](https://github.com/horizon-rust/horizon/issues/1786)
@@ -240,7 +240,7 @@ Horizon's own way to make shader packs, with tools to write and test them. Every
Technical -`horizon-shader-api` (API 0.1, experimental): WGSL stages with typed inputs inside the renderer's passes, options as WGSL override constants, and the `horizon-shader new|check|pack` tool with templates and the example pack Golden Hour. Merged: the check every pack passes ([#1820](https://github.com/ludovic111/horizon/issues/1820)) and the tool, templates and guide ([#1822](https://github.com/ludovic111/horizon/issues/1822)). In review: the post stage running in the game with hot reload ([#1861](https://github.com/ludovic111/horizon/issues/1861)), the sky stage ([#1863](https://github.com/ludovic111/horizon/issues/1863)) and registry checks that use the game's own check ([#1855](https://github.com/ludovic111/horizon/issues/1855)). Left: the material, lighting and shadow stages, a last-good fallback on reload, a GPU-time overlay per stage and budgets ([docs/shaders.md](docs/shaders.md), [docs/api/shaders.md](docs/api/shaders.md)). The Iris/OptiFine loader is a separate item, 'Shader packs, written again from scratch'. +`horizon-shader-api` (API 0.1, experimental): WGSL stages with typed inputs inside the renderer's passes, options as WGSL override constants, and the `horizon-shader new|check|pack` tool with templates and the example pack Golden Hour. Merged: the check every pack passes ([#1820](https://github.com/horizon-rust/horizon/issues/1820)) and the tool, templates and guide ([#1822](https://github.com/horizon-rust/horizon/issues/1822)). In review: the post stage running in the game with hot reload ([#1861](https://github.com/horizon-rust/horizon/issues/1861)), the sky stage ([#1863](https://github.com/horizon-rust/horizon/issues/1863)) and registry checks that use the game's own check ([#1855](https://github.com/horizon-rust/horizon/issues/1855)). Left: the material, lighting and shadow stages, a last-good fallback on reload, a GPU-time overlay per stage and budgets ([docs/shaders.md](docs/shaders.md), [docs/api/shaders.md](docs/api/shaders.md)). The Iris/OptiFine loader is a separate item, 'Shader packs, written again from scratch'.
@@ -252,7 +252,7 @@ Your Discord profile can show that you are playing Horizon, with a switch to tur
Technical -A Discord IPC client on its own thread ([#1787](https://github.com/ludovic111/horizon/issues/1787)) and the presence with its setting ([#1788](https://github.com/ludovic111/horizon/issues/1788)). Merged: it ships with the next release. +A Discord IPC client on its own thread ([#1787](https://github.com/horizon-rust/horizon/issues/1787)) and the presence with its setting ([#1788](https://github.com/horizon-rust/horizon/issues/1788)). Merged: it ships with the next release.
@@ -264,7 +264,7 @@ Cleaning up Horizon's code: removing what nothing uses and making it quicker to
Technical -A review of the whole tree: dead code and stubs removed ([#1432](https://github.com/ludovic111/horizon/issues/1432), [#1658](https://github.com/ludovic111/horizon/issues/1658)), one probe binary per crate ([#1453](https://github.com/ludovic111/horizon/issues/1453), [#1454](https://github.com/ludovic111/horizon/issues/1454)), shared harness helpers ([#1448](https://github.com/ludovic111/horizon/issues/1448)), clippy clean on the whole tree ([#1707](https://github.com/ludovic111/horizon/issues/1707)). [docs/architecture.md](docs/architecture.md) maps each feature to its files and harnesses. +A review of the whole tree: dead code and stubs removed ([#1432](https://github.com/horizon-rust/horizon/issues/1432), [#1658](https://github.com/horizon-rust/horizon/issues/1658)), one probe binary per crate ([#1453](https://github.com/horizon-rust/horizon/issues/1453), [#1454](https://github.com/horizon-rust/horizon/issues/1454)), shared harness helpers ([#1448](https://github.com/horizon-rust/horizon/issues/1448)), clippy clean on the whole tree ([#1707](https://github.com/horizon-rust/horizon/issues/1707)). [docs/architecture.md](docs/architecture.md) maps each feature to its files and harnesses.
@@ -278,7 +278,7 @@ New public numbers comparing Horizon with vanilla on many kinds of computers, me
Technical -Redo the comparison after the current performance work ([#1073](https://github.com/ludovic111/horizon/issues/1073)); reliability, coverage and presentation ([#1346](https://github.com/ludovic111/horizon/issues/1346)); a scene must count as loaded only once its first chunk arrives ([#1749](https://github.com/ludovic111/horizon/issues/1749)). Next: a performance history across releases (an automatic comparison of each release with the last, on a timeline), more report fields (server TPS and MSPT, power, battery drain, temperature, throttling) and more hardware (a MacBook on battery, low-end laptops, community reports). Players' reports come in through `--benchmark` and `horizon-launcher data benchmark` ([docs/benchmark.md](docs/benchmark.md)). +Redo the comparison after the current performance work ([#1073](https://github.com/horizon-rust/horizon/issues/1073)); reliability, coverage and presentation ([#1346](https://github.com/horizon-rust/horizon/issues/1346)); a scene must count as loaded only once its first chunk arrives ([#1749](https://github.com/horizon-rust/horizon/issues/1749)). Next: a performance history across releases (an automatic comparison of each release with the last, on a timeline), more report fields (server TPS and MSPT, power, battery drain, temperature, throttling) and more hardware (a MacBook on battery, low-end laptops, community reports). Players' reports come in through `--benchmark` and `horizon-launcher data benchmark` ([docs/benchmark.md](docs/benchmark.md)).
@@ -288,7 +288,7 @@ Creating a world and joining it should be quick even on a four-thread laptop, wh
Technical -Cut the per-column generation cost (noise sampling, surface rules, aquifers) and the lock convoy on structure starts, and leave one core free for the rest of the game as vanilla does ([#1760](https://github.com/ludovic111/horizon/issues/1760) and [#1778](https://github.com/ludovic111/horizon/issues/1778), in review, are listed under 'Steady frames at long render distances'). Still to profile on small CPUs: the first seconds of a fresh world deliver no chunk, and fluids remesh for about a minute after loading. Measured with `tools/perf_bench.py` ([docs/benchmark.md](docs/benchmark.md), [docs/profiling.md](docs/profiling.md)). +Cut the per-column generation cost (noise sampling, surface rules, aquifers) and the lock convoy on structure starts, and leave one core free for the rest of the game as vanilla does ([#1760](https://github.com/horizon-rust/horizon/issues/1760) and [#1778](https://github.com/horizon-rust/horizon/issues/1778), in review, are listed under 'Steady frames at long render distances'). Still to profile on small CPUs: the first seconds of a fresh world deliver no chunk, and fluids remesh for about a minute after loading. Measured with `tools/perf_bench.py` ([docs/benchmark.md](docs/benchmark.md), [docs/profiling.md](docs/profiling.md)).
@@ -320,7 +320,7 @@ Draw the game at a lower resolution and sharpen it to your screen's size, in the
Technical -A render-scale setting below the window size with an upscaler of our own that runs on every wgpu backend. Proof: frame time against native resolution on integrated GPUs, and screenshots for image quality. Issue [#1403](https://github.com/ludovic111/horizon/issues/1403). +A render-scale setting below the window size with an upscaler of our own that runs on every wgpu backend. Proof: frame time against native resolution on integrated GPUs, and screenshots for image quality. Issue [#1403](https://github.com/horizon-rust/horizon/issues/1403).
@@ -330,7 +330,7 @@ Several smaller speed-ups, each measured: idle block entities that sleep, cheape
Technical -Block entities and hoppers that skip work when idle (the hopper item scan is already skipped when no item is near); a particle frustum test first (also a parity gap), then particle quads built on the GPU; jigsaw shortcuts that skip blocked connectors and pool elements known not to fit, with layouts unchanged (trial chambers and ancient cities first); batched raw mouse input on Windows for 8000 Hz mice; a better atlas packer for huge resource packs (a 64x pack builds a 704 MiB atlas for 452 MiB of textures); sign-heavy scenes ([#1461](https://github.com/ludovic111/horizon/issues/1461)). Profile first, keep what pays, show before and after numbers. +Block entities and hoppers that skip work when idle (the hopper item scan is already skipped when no item is near); a particle frustum test first (also a parity gap), then particle quads built on the GPU; jigsaw shortcuts that skip blocked connectors and pool elements known not to fit, with layouts unchanged (trial chambers and ancient cities first); batched raw mouse input on Windows for 8000 Hz mice; a better atlas packer for huge resource packs (a 64x pack builds a 704 MiB atlas for 452 MiB of textures); sign-heavy scenes ([#1461](https://github.com/horizon-rust/horizon/issues/1461)). Profile first, keep what pays, show before and after numbers. More: [docs/profiling.md](docs/profiling.md) @@ -364,7 +364,7 @@ Making mods that add machines, magic and mobs work in Horizon, in steps, startin
Technical -333 of the 496 mods in a big pack (ATM10) contain code. Issue [#1854](https://github.com/ludovic111/horizon/issues/1854) ranks the API gaps (ticking block entities, networking, rendering, menus, inventories) that unlock them in tiers, with machines first as the recommended path and a furnace ported tick for tick as proof. The first API step is a draft ([#1189](https://github.com/ludovic111/horizon/issues/1189), see 'Machines and blocks with inventories'). The path isn't started yet ([docs/modpacks.md](docs/modpacks.md)). +333 of the 496 mods in a big pack (ATM10) contain code. Issue [#1854](https://github.com/horizon-rust/horizon/issues/1854) ranks the API gaps (ticking block entities, networking, rendering, menus, inventories) that unlock them in tiers, with machines first as the recommended path and a furnace ported tick for tick as proof. The first API step is a draft ([#1189](https://github.com/horizon-rust/horizon/issues/1189), see 'Machines and blocks with inventories'). The path isn't started yet ([docs/modpacks.md](docs/modpacks.md)).
@@ -386,7 +386,7 @@ Set up Horizon, a server first, without Java on your computer: published tables
Technical -Today `horizon-prepare` runs Mojang's exporters with Java. Issue [#1750](https://github.com/ludovic111/horizon/issues/1750) proposes publishing the computed version tables once from CI and assembling the rest locally from the player's own jar and assets, provided the tables hold no Mojang content; a contributor offered a pull request, and it would help phones too. A server-only prepare from `server.jar` alone is the first step ([docs/server.md](docs/server.md)). +Today `horizon-prepare` runs Mojang's exporters with Java. Issue [#1750](https://github.com/horizon-rust/horizon/issues/1750) proposes publishing the computed version tables once from CI and assembling the rest locally from the player's own jar and assets, provided the tables hold no Mojang content; a contributor offered a pull request, and it would help phones too. A server-only prepare from `server.jar` alone is the first step ([docs/server.md](docs/server.md)).
@@ -406,7 +406,7 @@ Smoother hosting: a real Windows service, a backup before every update, backups
Technical -A Windows service wrapper instead of the logon scheduled task; `backups.before_update`; hot reload of config for view distance and the message of the day (needs engine support); backups that keep world and player state ([#1808](https://github.com/ludovic111/horizon/issues/1808), a contributor's draft, in review). [docs/hosting.md](docs/hosting.md), docs/server.md. +A Windows service wrapper instead of the logon scheduled task; `backups.before_update`; hot reload of config for view distance and the message of the day (needs engine support); backups that keep world and player state ([#1808](https://github.com/horizon-rust/horizon/issues/1808), a contributor's draft, in review). [docs/hosting.md](docs/hosting.md), docs/server.md.
@@ -464,7 +464,7 @@ Mods that add machines: blocks that tick, hold items and have their own menus. T
Technical -Block entities and menus: ticking machines with slots, server menu logic and the menu protocol to clients, energy, item and fluid transfer, data attachments, accessory slots and custom recipe types, with a typed client and server channel and typed config beside them. A draft ([#1189](https://github.com/ludovic111/horizon/issues/1189)) proves a furnace ported tick for tick and holds the ATM10 code-mods plan; the design is redone through the API policy before it merges ([docs/modpacks.md](docs/modpacks.md), docs/api/stability.md). +Block entities and menus: ticking machines with slots, server menu logic and the menu protocol to clients, energy, item and fluid transfer, data attachments, accessory slots and custom recipe types, with a typed client and server channel and typed config beside them. A draft ([#1189](https://github.com/horizon-rust/horizon/issues/1189)) proves a furnace ported tick for tick and holds the ATM10 code-mods plan; the design is redone through the API policy before it merges ([docs/modpacks.md](docs/modpacks.md), docs/api/stability.md).
@@ -486,7 +486,7 @@ Pistons and slime blocks will push players, mobs and items as in vanilla. Today
Technical -Port `PistonMovingBlockEntity.moveCollidedEntities` and `moveStuckEntities` (honey), the slime bounce and `Entity.limitPistonMovement` for `MoverType.PISTON`, in single player and for a server's players. Issues [#1496](https://github.com/ludovic111/horizon/issues/1496), [#1609](https://github.com/ludovic111/horizon/issues/1609), [#1608](https://github.com/ludovic111/horizon/issues/1608), [#1704](https://github.com/ludovic111/horizon/issues/1704), [#1758](https://github.com/ludovic111/horizon/issues/1758). +Port `PistonMovingBlockEntity.moveCollidedEntities` and `moveStuckEntities` (honey), the slime bounce and `Entity.limitPistonMovement` for `MoverType.PISTON`, in single player and for a server's players. Issues [#1496](https://github.com/horizon-rust/horizon/issues/1496), [#1609](https://github.com/horizon-rust/horizon/issues/1609), [#1608](https://github.com/horizon-rust/horizon/issues/1608), [#1704](https://github.com/horizon-rust/horizon/issues/1704), [#1758](https://github.com/horizon-rust/horizon/issues/1758).
@@ -506,7 +506,7 @@ Villages and fights behaving as in vanilla: iron golems defending villages, vill
Technical -Villages: iron golem village goals, villager memories across saves, villager age, job-site claiming on dedicated servers, flower offers ([#1639](https://github.com/ludovic111/horizon/issues/1639) is one report). Combat: the mobs' `attack_knockback` attribute, mace smash logic, the hit knockback source on the host, the fire burnout biome tag. Each is checked against vanilla by a harness ([docs/rust-parity.md](docs/rust-parity.md)). +Villages: iron golem village goals, villager memories across saves, villager age, job-site claiming on dedicated servers, flower offers ([#1639](https://github.com/horizon-rust/horizon/issues/1639) is one report). Combat: the mobs' `attack_knockback` attribute, mace smash logic, the hit knockback source on the host, the fire burnout biome tag. Each is checked against vanilla by a harness ([docs/rust-parity.md](docs/rust-parity.md)).
@@ -516,7 +516,7 @@ Pick the speakers or headphones Horizon plays through, in Music & Sounds.
Technical -An output device list in Music & Sounds, falling back to the system default. [#1035](https://github.com/ludovic111/horizon/issues/1035) started it: a player on an older Windows computer had no sound at all, and a device choice is how such cases are found and fixed. +An output device list in Music & Sounds, falling back to the system default. [#1035](https://github.com/horizon-rust/horizon/issues/1035) started it: a player on an older Windows computer had no sound at all, and a device choice is how such cases are found and fixed.
@@ -544,7 +544,7 @@ Coming soon: sign in with your Microsoft account to play on online-mode servers. Device-code sign-in in the launcher and online-mode login in the client ([docs/microsoft-account.md](docs/microsoft-account.md)). It is turned on by setting the app's client id once Minecraft API access is approved; until then the launcher shows "Coming soon". -More: [#1270](https://github.com/ludovic111/horizon/issues/1270) +More: [#1270](https://github.com/horizon-rust/horizon/issues/1270)
@@ -566,7 +566,7 @@ Builds of the game and the launcher for Macs with an Intel processor.
Technical -x86_64 game and launcher builds, picked per processor ([#1171](https://github.com/ludovic111/horizon/issues/1171)). Before it ships it needs a run on a real Intel Mac: Rosetta on Apple Silicon only proves the CPU code. Requests: [#1161](https://github.com/ludovic111/horizon/issues/1161), [#1792](https://github.com/ludovic111/horizon/issues/1792). +x86_64 game and launcher builds, picked per processor ([#1171](https://github.com/horizon-rust/horizon/issues/1171)). Before it ships it needs a run on a real Intel Mac: Rosetta on Apple Silicon only proves the CPU code. Requests: [#1161](https://github.com/horizon-rust/horizon/issues/1161), [#1792](https://github.com/horizon-rust/horizon/issues/1792).
@@ -576,7 +576,7 @@ Fixes for Linux desktops that use Wayland and Hyprland: fullscreen, the clipboar
Technical -Open: the GUI Scale is clamped to 2 after a restart under Hyprland, while XWayland keeps it ([#1866](https://github.com/ludovic111/horizon/issues/1866)). Earlier reports covered fullscreen dropping on menu clicks, the clipboard and a white overlay ([#1007](https://github.com/ludovic111/horizon/issues/1007), closed). Checked on a real Wayland session. +Open: the GUI Scale is clamped to 2 after a restart under Hyprland, while XWayland keeps it ([#1866](https://github.com/horizon-rust/horizon/issues/1866)). Earlier reports covered fullscreen dropping on menu clicks, the clipboard and a white overlay ([#1007](https://github.com/horizon-rust/horizon/issues/1007), closed). Checked on a real Wayland session.
@@ -626,7 +626,7 @@ Safer releases: changes to the release machinery need the owner's review, and AI
Technical -`.github/CODEOWNERS` lists the workflows, the release and signing tools, the update-checking code and the installers ([#1015](https://github.com/ludovic111/horizon/issues/1015)); the branch protection that makes it count waits for the `horizon-agent` GitHub App, which reads and writes code, pull requests and issues but can't change settings, workflows, secrets or members, and whose tokens last an hour. It needs the owner to create the App and switch the protection on ([docs/security.md](docs/security.md)). +`.github/CODEOWNERS` lists the workflows, the release and signing tools, the update-checking code and the installers ([#1015](https://github.com/horizon-rust/horizon/issues/1015)); the branch protection that makes it count waits for the `horizon-agent` GitHub App, which reads and writes code, pull requests and issues but can't change settings, workflows, secrets or members, and whose tokens last an hour. It needs the owner to create the App and switch the protection on ([docs/security.md](docs/security.md)).
@@ -636,7 +636,7 @@ Every download Horizon makes is checked against the project's signature, includi
Technical -Releases carry signed checksums, and the launcher and `horizon-server update` refuse anything unsigned ([#1011](https://github.com/ludovic111/horizon/issues/1011), [#1014](https://github.com/ludovic111/horizon/issues/1014)). Left: the first install through `install.sh` and `install.ps1` still trusts only the checksum GitHub publishes, because verifying Ed25519 signatures needs OpenSSL 3, which macOS doesn't ship ([docs/security.md](docs/security.md)). +Releases carry signed checksums, and the launcher and `horizon-server update` refuse anything unsigned ([#1011](https://github.com/horizon-rust/horizon/issues/1011), [#1014](https://github.com/horizon-rust/horizon/issues/1014)). Left: the first install through `install.sh` and `install.ps1` still trusts only the checksum GitHub publishes, because verifying Ed25519 signatures needs OpenSSL 3, which macOS doesn't ship ([docs/security.md](docs/security.md)).
@@ -650,7 +650,7 @@ Far terrain drawn from the world you really built and explored, caves and builds
Technical -Keep a 3D mip store on disk built from real chunks, drawn by the GPU beside the seed preview for areas nobody has visited. Written from scratch and measured before it is kept. Builds on Far Detail and the far-terrain levels of detail already shipped; the open work on them is [#718](https://github.com/ludovic111/horizon/issues/718). +Keep a 3D mip store on disk built from real chunks, drawn by the GPU beside the seed preview for areas nobody has visited. Written from scratch and measured before it is kept. Builds on Far Detail and the far-terrain levels of detail already shipped; the open work on them is [#718](https://github.com/horizon-rust/horizon/issues/718).
@@ -692,7 +692,7 @@ Run Java mods that nobody has rewritten for Horizon yet, through a bridge or a c
Technical -Earlier research ([#527](https://github.com/ludovic111/horizon/issues/527), closed) found that Java mods can't simply run, because they call Minecraft's own classes. Options to look at again: a jar-to-WebAssembly backend, or a bridge for simple Fabric mods. Whatever is chosen has to run inside the same sandbox and capability checks as native mods. +Earlier research ([#527](https://github.com/horizon-rust/horizon/issues/527), closed) found that Java mods can't simply run, because they call Minecraft's own classes. Options to look at again: a jar-to-WebAssembly backend, or a bridge for simple Fabric mods. Whatever is chosen has to run inside the same sandbox and capability checks as native mods.
@@ -704,7 +704,7 @@ Sign in with other account providers, such as Ely.by or any Yggdrasil-compatible
Technical -Issue [#1270](https://github.com/ludovic111/horizon/issues/1270) asks for Ely.by and Yggdrasil-compatible servers with an account selector in the launcher. It builds on the Microsoft sign-in ([docs/microsoft-account.md](docs/microsoft-account.md)). +Issue [#1270](https://github.com/horizon-rust/horizon/issues/1270) asks for Ely.by and Yggdrasil-compatible servers with an account selector in the launcher. It builds on the Microsoft sign-in ([docs/microsoft-account.md](docs/microsoft-account.md)).
@@ -748,7 +748,7 @@ Contraptions and physics like the Create and Aeronautics mods, as a mod for Hori
Technical -Issue [#805](https://github.com/ludovic111/horizon/issues/805) (porting QOL mods) closed with this answer: it would come as a native Horizon mod on the mod API. It needs server mods, entities and rendering first. +Issue [#805](https://github.com/horizon-rust/horizon/issues/805) (porting QOL mods) closed with this answer: it would come as a native Horizon mod on the mod API. It needs server mods, entities and rendering first.
@@ -790,7 +790,7 @@ Vanilla's complete F3 screen: debug options, a profiler chart, ten-second captur
Technical -Today F3 shows position, chunk, light, biome and FPS ([docs/native-client.md](docs/native-client.md)). Vanilla also has F3+F6 debug options with profiles, F3+1 the profiler pie, F3+L a ten-second capture and F3+S the atlas dump ([#562](https://github.com/ludovic111/horizon/issues/562) asked for the F3 editor). +Today F3 shows position, chunk, light, biome and FPS ([docs/native-client.md](docs/native-client.md)). Vanilla also has F3+F6 debug options with profiles, F3+1 the profiler pie, F3+L a ten-second capture and F3+S the atlas dump ([#562](https://github.com/horizon-rust/horizon/issues/562) asked for the F3 editor).
@@ -814,7 +814,7 @@ An optional ray-tracing mode for graphics cards that support it (RTX and recent
Technical -A spike with ray-traced sun shadows, off by default, is a draft ([#1180](https://github.com/ludovic111/horizon/issues/1180)). Reflections, global illumination, Apple M3 and newer if it is cheap, and a performance report per card come after. +A spike with ray-traced sun shadows, off by default, is a draft ([#1180](https://github.com/horizon-rust/horizon/issues/1180)). Reflections, global illumination, Apple M3 and newer if it is cheap, and a performance report per card come after.
@@ -824,7 +824,7 @@ Output for HDR monitors: brighter highlights and richer colour where your screen
Technical -Issue [#1441](https://github.com/ludovic111/horizon/issues/1441). Needs a surface format and a tone-mapping path per backend, and tests on real HDR screens on Windows, macOS and Linux. +Issue [#1441](https://github.com/horizon-rust/horizon/issues/1441). Needs a surface format and a tone-mapping path per backend, and tests on real HDR screens on Windows, macOS and Linux.
@@ -858,7 +858,7 @@ Game and launcher builds for 64-bit ARM Linux computers.
Technical -Issue [#1709](https://github.com/ludovic111/horizon/issues/1709): aarch64 builds of the game and the launcher in the release workflow, tested on a real ARM machine with its Vulkan driver. The server build already drops audio and controllers (`--no-default-features`). +Issue [#1709](https://github.com/horizon-rust/horizon/issues/1709): aarch64 builds of the game and the launcher in the release workflow, tested on a real ARM machine with its Vulkan driver. The server build already drops audio and controllers (`--no-default-features`).
@@ -868,7 +868,7 @@ Versions of Horizon for Android, iOS and web browsers. Nothing official yet; con
Technical -No official build. Android was first closed as not planned, with touch controls, a mobile interface, packaging and loading the player's own assets all missing; the roadmap now includes it, iOS and a WebAssembly build for the browser as long-term goals. First pieces from contributors: `horizon-dualsense` compiling on iOS ([#1813](https://github.com/ludovic111/horizon/issues/1813)) and helper-thread limits on Android ([#1751](https://github.com/ludovic111/horizon/issues/1751)). Preparing without Java ([#1750](https://github.com/ludovic111/horizon/issues/1750)) matters here too. Horizon ships none of Mojang's files on any platform. +No official build. Android was first closed as not planned, with touch controls, a mobile interface, packaging and loading the player's own assets all missing; the roadmap now includes it, iOS and a WebAssembly build for the browser as long-term goals. First pieces from contributors: `horizon-dualsense` compiling on iOS ([#1813](https://github.com/horizon-rust/horizon/issues/1813)) and helper-thread limits on Android ([#1751](https://github.com/horizon-rust/horizon/issues/1751)). Preparing without Java ([#1750](https://github.com/horizon-rust/horizon/issues/1750)) matters here too. Horizon ships none of Mojang's files on any platform.
@@ -912,7 +912,7 @@ An optional AI teammate you can talk to by voice. It plays beside you, helps or
Technical -Draft pull requests: the companion ([#1068](https://github.com/ludovic111/horizon/issues/1068)), its safety modes and their evaluation ([#1069](https://github.com/ludovic111/horizon/issues/1069)) and a route that finishes the game ([#1070](https://github.com/ludovic111/horizon/issues/1070)). In the drafts: a companion that follows, fights, mines, crafts, sleeps and respawns; chat and push-to-talk voice, with speech recognition and a choice of voices; presets (very strong, helper, beat the game); a guard model with Clean, Kid and Salty modes; perception levels from Fair to All-knowing; hardware detection with a simple mode and an Advanced tab; local models first, cloud keys optional. The No AI switch is already in the game. Left: the speedrun route doesn't finish the game reliably yet, voices for more languages, and the safety evaluation, which must pass before it ships. +Draft pull requests: the companion ([#1068](https://github.com/horizon-rust/horizon/issues/1068)), its safety modes and their evaluation ([#1069](https://github.com/horizon-rust/horizon/issues/1069)) and a route that finishes the game ([#1070](https://github.com/horizon-rust/horizon/issues/1070)). In the drafts: a companion that follows, fights, mines, crafts, sleeps and respawns; chat and push-to-talk voice, with speech recognition and a choice of voices; presets (very strong, helper, beat the game); a guard model with Clean, Kid and Salty modes; perception levels from Fair to All-knowing; hardware detection with a simple mode and an Advanced tab; local models first, cloud keys optional. The No AI switch is already in the game. Left: the speedrun route doesn't finish the game reliably yet, voices for more languages, and the safety evaluation, which must pass before it ships.
@@ -938,7 +938,7 @@ Run Horizon's built-in benchmark and share the report: every new computer makes
Technical -`horizon-launcher play --arg=--benchmark --arg=standard` writes a JSON report; `horizon-launcher data benchmark ` shows what would be sent and uploads it (playhorizon.dev/docs/performance). Results from three installs with the same hardware appear on the Benchmarks page. Example: [#1711](https://github.com/ludovic111/horizon/issues/1711). +`horizon-launcher play --arg=--benchmark --arg=standard` writes a JSON report; `horizon-launcher data benchmark ` shows what would be sent and uploads it (playhorizon.dev/docs/performance). Results from three installs with the same hardware appear on the Benchmarks page. Example: [#1711](https://github.com/horizon-rust/horizon/issues/1711). More: [https://playhorizon.dev/docs/performance](https://playhorizon.dev/docs/performance) @@ -952,7 +952,7 @@ Banners in End cities show as plain magenta instead of with their pattern.
Technical -Compare the banner block entities the End city templates place with vanilla's (`EndCityPieces`, the templates' block entity NBT, `BannerBlockEntity`'s patterns), in `crates/horizon-world/src/worldgen/structure/`. Issue [#1438](https://github.com/ludovic111/horizon/issues/1438); possibly related: [#526](https://github.com/ludovic111/horizon/issues/526). +Compare the banner block entities the End city templates place with vanilla's (`EndCityPieces`, the templates' block entity NBT, `BannerBlockEntity`'s patterns), in `crates/horizon-world/src/worldgen/structure/`. Issue [#1438](https://github.com/horizon-rust/horizon/issues/1438); possibly related: [#526](https://github.com/horizon-rust/horizon/issues/526).
@@ -962,19 +962,19 @@ Armour and tools in End city chests should come enchanted, as in vanilla.
Technical -`loot.rs` implements `enchant_with_levels`: find why the End city chest table's rolls come out bare, and compare them with vanilla's for a few seeds. Issues [#1437](https://github.com/ludovic111/horizon/issues/1437), [#1660](https://github.com/ludovic111/horizon/issues/1660). +`loot.rs` implements `enchant_with_levels`: find why the End city chest table's rolls come out bare, and compare them with vanilla's for a few seeds. Issues [#1437](https://github.com/horizon-rust/horizon/issues/1437), [#1660](https://github.com/horizon-rust/horizon/issues/1660).
## Recently shipped -- **OpenGL for old computers** (v0.2.63): Horizon now starts on old PCs whose graphics card has no Vulkan or DirectX 12 driver: it switches to OpenGL by itself, and Options > Graphics can pick OpenGL by hand. [#1917](https://github.com/ludovic111/horizon/issues/1917) · [#1920](https://github.com/ludovic111/horizon/issues/1920) · [#1936](https://github.com/ludovic111/horizon/issues/1936) -- **Server resource packs** (v0.2.48): Servers can send you their resource pack: Horizon asks, downloads it and applies it, like vanilla. [#1562](https://github.com/ludovic111/horizon/issues/1562) · [#1569](https://github.com/ludovic111/horizon/issues/1569) · [#1570](https://github.com/ludovic111/horizon/issues/1570) -- **Single player on its own server thread** (v0.2.39): Single player runs on a server thread, as vanilla does, so the world keeps ticking smoothly while the window draws. [#1514](https://github.com/ludovic111/horizon/issues/1514) · [docs/server-levels.md](docs/server-levels.md) -- **GPU occlusion culling on Macs** (v0.2.17): On Macs the GPU now skips terrain hidden behind hills and caves: 8 to 48% more frames per second at 32 chunks on an M4 Pro. [#1434](https://github.com/ludovic111/horizon/issues/1434) -- **Animated textures on the GPU** (v0.2.5): Water, lava and other animated blocks are now animated by the graphics card: 1.7 to 2.4 times better 1% lows on Intel graphics. [#1239](https://github.com/ludovic111/horizon/issues/1239) -- **Far Detail for integrated graphics** (v0.2.5): An optional Reduced setting for far terrain, suggested on integrated graphics, that saves 2 to 4 ms of GPU time per frame. [#1199](https://github.com/ludovic111/horizon/issues/1199) · [#1029](https://github.com/ludovic111/horizon/issues/1029) -- **The launcher's mod browser** (launcher@0.2.0): Search Modrinth for mods, modpacks and resource packs from the launcher; it says before installing what works in Horizon. [#1154](https://github.com/ludovic111/horizon/issues/1154) · [#1242](https://github.com/ludovic111/horizon/issues/1242) · [#1243](https://github.com/ludovic111/horizon/issues/1243) · [#1246](https://github.com/ludovic111/horizon/issues/1246) · [docs/mod-browser.md](docs/mod-browser.md) -- **A blocky, Minecraft-like launcher** (launcher@0.2.0): The launcher got a new blocky look in Horizon's purple, in dark and light. [#1269](https://github.com/ludovic111/horizon/issues/1269) · [docs/design-system.md](docs/design-system.md) -- **Dynamic lights** (v2026.10.22): An optional extra: torches you hold, drop or set on fire light up what is around them. [#1162](https://github.com/ludovic111/horizon/issues/1162) -- **Host a server from the launcher** (launcher-v0.15.0): The launcher's Servers page creates, starts, backs up and updates a Horizon server with buttons, and invites friends. [#1026](https://github.com/ludovic111/horizon/issues/1026) · [docs/hosting.md](docs/hosting.md) +- **OpenGL for old computers** (v0.2.63): Horizon now starts on old PCs whose graphics card has no Vulkan or DirectX 12 driver: it switches to OpenGL by itself, and Options > Graphics can pick OpenGL by hand. [#1917](https://github.com/horizon-rust/horizon/issues/1917) · [#1920](https://github.com/horizon-rust/horizon/issues/1920) · [#1936](https://github.com/horizon-rust/horizon/issues/1936) +- **Server resource packs** (v0.2.48): Servers can send you their resource pack: Horizon asks, downloads it and applies it, like vanilla. [#1562](https://github.com/horizon-rust/horizon/issues/1562) · [#1569](https://github.com/horizon-rust/horizon/issues/1569) · [#1570](https://github.com/horizon-rust/horizon/issues/1570) +- **Single player on its own server thread** (v0.2.39): Single player runs on a server thread, as vanilla does, so the world keeps ticking smoothly while the window draws. [#1514](https://github.com/horizon-rust/horizon/issues/1514) · [docs/server-levels.md](docs/server-levels.md) +- **GPU occlusion culling on Macs** (v0.2.17): On Macs the GPU now skips terrain hidden behind hills and caves: 8 to 48% more frames per second at 32 chunks on an M4 Pro. [#1434](https://github.com/horizon-rust/horizon/issues/1434) +- **Animated textures on the GPU** (v0.2.5): Water, lava and other animated blocks are now animated by the graphics card: 1.7 to 2.4 times better 1% lows on Intel graphics. [#1239](https://github.com/horizon-rust/horizon/issues/1239) +- **Far Detail for integrated graphics** (v0.2.5): An optional Reduced setting for far terrain, suggested on integrated graphics, that saves 2 to 4 ms of GPU time per frame. [#1199](https://github.com/horizon-rust/horizon/issues/1199) · [#1029](https://github.com/horizon-rust/horizon/issues/1029) +- **The launcher's mod browser** (launcher@0.2.0): Search Modrinth for mods, modpacks and resource packs from the launcher; it says before installing what works in Horizon. [#1154](https://github.com/horizon-rust/horizon/issues/1154) · [#1242](https://github.com/horizon-rust/horizon/issues/1242) · [#1243](https://github.com/horizon-rust/horizon/issues/1243) · [#1246](https://github.com/horizon-rust/horizon/issues/1246) · [docs/mod-browser.md](docs/mod-browser.md) +- **A blocky, Minecraft-like launcher** (launcher@0.2.0): The launcher got a new blocky look in Horizon's purple, in dark and light. [#1269](https://github.com/horizon-rust/horizon/issues/1269) · [docs/design-system.md](docs/design-system.md) +- **Dynamic lights** (v2026.10.22): An optional extra: torches you hold, drop or set on fire light up what is around them. [#1162](https://github.com/horizon-rust/horizon/issues/1162) +- **Host a server from the launcher** (launcher-v0.15.0): The launcher's Servers page creates, starts, backs up and updates a Horizon server with buttons, and invites friends. [#1026](https://github.com/horizon-rust/horizon/issues/1026) · [docs/hosting.md](docs/hosting.md) diff --git a/benchmarks/server-equal-mixed-2026-10-18/README.md b/benchmarks/server-equal-mixed-2026-10-18/README.md index 5849e72ba..695f08c81 100644 --- a/benchmarks/server-equal-mixed-2026-10-18/README.md +++ b/benchmarks/server-equal-mixed-2026-10-18/README.md @@ -119,7 +119,7 @@ machines during the runs. ## Reproduce - curl -fsSL https://raw.githubusercontent.com/ludovic111/horizon/main/packaging/server/install.sh | sh + curl -fsSL https://raw.githubusercontent.com/horizon-rust/horizon/main/packaging/server/install.sh | sh horizon-prepare --prepare --server-jar /path/to/server.jar # your own copy cargo build --release -p horizon-bots # on the machine that runs the bots # in a checkout whose .local/minecraft holds the pinned vanilla jars (tools/lab.py prepare): diff --git a/benchmarks/server-four-way-2026-10-19/README.md b/benchmarks/server-four-way-2026-10-19/README.md index 7048c2743..1c8b7b07e 100644 --- a/benchmarks/server-four-way-2026-10-19/README.md +++ b/benchmarks/server-four-way-2026-10-19/README.md @@ -148,7 +148,7 @@ early, wrote no report. Its lines come from its output. ## Reproduce - curl -fsSL https://raw.githubusercontent.com/ludovic111/horizon/main/packaging/server/install.sh | sh + curl -fsSL https://raw.githubusercontent.com/horizon-rust/horizon/main/packaging/server/install.sh | sh horizon-prepare --prepare --server-jar /path/to/server.jar # your own copy cargo build --release -p horizon-bots # on the machine that runs the bots # in a checkout whose .local/minecraft holds the pinned vanilla jars (tools/lab.py prepare): diff --git a/benchmarks/server-mixed-2026-10-18/README.md b/benchmarks/server-mixed-2026-10-18/README.md index 3cbe3897f..a55f5999d 100644 --- a/benchmarks/server-mixed-2026-10-18/README.md +++ b/benchmarks/server-mixed-2026-10-18/README.md @@ -103,7 +103,7 @@ the Nix store, so the run set `LD_LIBRARY_PATH` to them (see #898). ## Reproduce - curl -fsSL https://raw.githubusercontent.com/ludovic111/horizon/main/packaging/server/install.sh | sh + curl -fsSL https://raw.githubusercontent.com/horizon-rust/horizon/main/packaging/server/install.sh | sh horizon-prepare --prepare --server-jar /path/to/server.jar # your own copy cargo build --release -p horizon-bots # on the machine that runs the bots # in a checkout whose .local/minecraft holds the pinned vanilla jars (tools/lab.py prepare): diff --git a/crates/cargo-horizon-mod/src/main.rs b/crates/cargo-horizon-mod/src/main.rs index b82c6d07f..95d0a9eb3 100644 --- a/crates/cargo-horizon-mod/src/main.rs +++ b/crates/cargo-horizon-mod/src/main.rs @@ -25,7 +25,7 @@ use std::{ }; const TARGET: &str = "wasm32-unknown-unknown"; -const SDK_GIT: &str = "{ git = \"https://github.com/ludovic111/horizon\" }"; +const SDK_GIT: &str = "{ git = \"https://github.com/horizon-rust/horizon\" }"; fn main() -> ExitCode { // Cargo runs `cargo-horizon-mod horizon-mod `. diff --git a/crates/cargo-horizon-mod/src/registry.rs b/crates/cargo-horizon-mod/src/registry.rs index ac5e77ea4..4e78daf26 100644 --- a/crates/cargo-horizon-mod/src/registry.rs +++ b/crates/cargo-horizon-mod/src/registry.rs @@ -1,5 +1,5 @@ //! `cargo horizon-mod registry build|review|check|list`: the registry repository's CI -//! (`ludovic111/horizon-mods`, docs/api/mod-index.md). Network-free: the +//! (`horizon-rust/horizon-mods`, docs/api/mod-index.md). Network-free: the //! workflow downloads the files and publishes what this writes. use horizon_mods::index::{ FILE_HOST, @@ -8,7 +8,7 @@ use horizon_mods::index::{ use std::path::Path; /// Where the registry's site is published (its icons). -const SITE: &str = "https://ludovic111.github.io/horizon-mods/"; +const SITE: &str = "https://horizon-rust.github.io/horizon-mods/"; const USAGE: &str = "usage: cargo horizon-mod registry build --files --out [--release ] [--site ] [--generated