Merge branch 'refactor/be-layer-deps' into refactor/furnace-cooking

This commit is contained in:
Ludovic Marie
2026-10-27 22:36:31 +01:00
113 changed files with 1625 additions and 300 deletions
-7
View File
@@ -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)
+8
View File
@@ -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)
+2 -2
View File
@@ -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
+48
View File
@@ -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
+4 -3
View File
@@ -39,6 +39,7 @@ Game workspace (root `Cargo.toml`); `launcher/` and `crates/horizon-telemetry-se
| `horizon-items` | Blocks and items below gameplay: `blocks.rs` (block facts), `items.rs`, `item_data.rs` (components), `enchant.rs`, `cooldowns.rs`, `bundle.rs`, `item_nbt.rs`. Re-exported as `horizon_client::items`... |
| `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` |
@@ -58,7 +59,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
@@ -114,7 +115,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/`) |
@@ -130,7 +131,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)) |
+1 -1
View File
@@ -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.
Generated
+13 -1
View File
@@ -1370,7 +1370,6 @@ name = "horizon-client"
version = "0.1.0"
dependencies = [
"ab_glyph",
"arboard",
"bytemuck",
"chrono",
"cpal",
@@ -1380,6 +1379,7 @@ dependencies = [
"horizon-assets",
"horizon-bench",
"horizon-client-core",
"horizon-client-input",
"horizon-command",
"horizon-core",
"horizon-dualsense",
@@ -1422,6 +1422,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"
+1
View File
@@ -8,6 +8,7 @@ members = [
"crates/horizon-world",
"crates/horizon-client",
"crates/horizon-client-core",
"crates/horizon-client-input",
"crates/horizon-command",
"crates/horizon-items",
"crates/horizon-server-files",
+4 -4
View File
@@ -3,7 +3,7 @@
</p>
<p align="center">
<a href="https://github.com/ludovic111/horizon/actions/workflows/ci.yml"><img src="https://github.com/ludovic111/horizon/actions/workflows/ci.yml/badge.svg?branch=main" alt="CI"></a>
<a href="https://github.com/horizon-rust/horizon/actions/workflows/ci.yml"><img src="https://github.com/horizon-rust/horizon/actions/workflows/ci.yml/badge.svg?branch=main" alt="CI"></a>
<img src="https://img.shields.io/badge/Minecraft-Java%2026.3-5D9C3F" alt="Minecraft Java 26.3">
<img src="https://img.shields.io/badge/Rust-stable-B7410E?logo=rust&logoColor=white" alt="Rust">
<img src="https://img.shields.io/badge/vanilla%20parity-100%25-F0795A" alt="Vanilla parity 100%">
@@ -15,7 +15,7 @@
<a href="https://playhorizon.dev"><b>Website</b></a> ·
<a href="#download"><b>Download</b></a> ·
<a href="https://playhorizon.dev/docs/"><b>Documentation</b></a> ·
<a href="https://github.com/ludovic111/horizon/releases"><b>Release notes</b></a> ·
<a href="https://github.com/horizon-rust/horizon/releases"><b>Release notes</b></a> ·
<a href="ROADMAP.md"><b>Roadmap</b></a> ·
<a href="#project-status"><b>Project status</b></a> ·
<a href="#contributing"><b>Contributing</b></a>
@@ -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
+66 -66
View File
@@ -32,7 +32,7 @@ Making Horizon faster than vanilla on every computer, with smooth camera movemen
<details><summary>Technical</summary>
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)).
</details>
@@ -42,7 +42,7 @@ Speeding up the code that reads and writes the blocks of the world, which almost
<details><summary>Technical</summary>
`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)).
</details>
@@ -54,7 +54,7 @@ Making the world-generation mods of popular modpacks (new structures, YUNG's dun
<details><summary>Technical</summary>
`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)).
</details>
@@ -66,7 +66,7 @@ When you play on a server, other players, mobs, items and menus look and behave
<details><summary>Technical</summary>
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)).
</details>
@@ -76,7 +76,7 @@ Servers that show dialogs, such as the register and login screens of AuthMe, wil
<details><summary>Technical</summary>
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)).
</details>
@@ -86,7 +86,7 @@ A /pregen command that builds an area of the world ahead of time, so players don
<details><summary>Technical</summary>
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'.
</details>
@@ -98,7 +98,7 @@ One place for mods, modpacks and resource packs made for Horizon: browse them on
<details><summary>Technical</summary>
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
<details><summary>Technical</summary>
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).
</details>
@@ -120,7 +120,7 @@ Mods will be able to open their own screens and settings pages and react to keys
<details><summary>Technical</summary>
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
<details><summary>Technical</summary>
`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
<details><summary>Technical</summary>
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).
</details>
@@ -156,7 +156,7 @@ Item names, container titles and server messages follow the language you pick, a
<details><summary>Technical</summary>
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)).
</details>
@@ -166,9 +166,9 @@ After you throw an ender pearl, its slot should show the cooldown sweeping away,
<details><summary>Technical</summary>
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)
</details>
@@ -178,9 +178,9 @@ The Hidden and Commands Only chat settings should hide chat, and team prefixes s
<details><summary>Technical</summary>
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)
</details>
@@ -190,9 +190,9 @@ The mouse pointer should turn into a pointing hand over menu buttons, as in vani
<details><summary>Technical</summary>
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)
</details>
@@ -202,9 +202,9 @@ Ctrl+Backspace should delete a whole word in the creative search, and every list
<details><summary>Technical</summary>
`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)
</details>
@@ -214,9 +214,9 @@ Chickens should flap their wings while they fall, not stand still in the air.
<details><summary>Technical</summary>
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)
</details>
@@ -228,9 +228,9 @@ Shader packs were removed and are being rebuilt from scratch. They come back, of
<details><summary>Technical</summary>
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)
</details>
@@ -240,7 +240,7 @@ Horizon's own way to make shader packs, with tools to write and test them. Every
<details><summary>Technical</summary>
`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'.
</details>
@@ -252,7 +252,7 @@ Your Discord profile can show that you are playing Horizon, with a switch to tur
<details><summary>Technical</summary>
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.
</details>
@@ -264,7 +264,7 @@ Cleaning up Horizon's code: removing what nothing uses and making it quicker to
<details><summary>Technical</summary>
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.
</details>
@@ -278,7 +278,7 @@ New public numbers comparing Horizon with vanilla on many kinds of computers, me
<details><summary>Technical</summary>
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)).
</details>
@@ -288,7 +288,7 @@ Creating a world and joining it should be quick even on a four-thread laptop, wh
<details><summary>Technical</summary>
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)).
</details>
@@ -320,7 +320,7 @@ Draw the game at a lower resolution and sharpen it to your screen's size, in the
<details><summary>Technical</summary>
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).
</details>
@@ -330,7 +330,7 @@ Several smaller speed-ups, each measured: idle block entities that sleep, cheape
<details><summary>Technical</summary>
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
<details><summary>Technical</summary>
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)).
</details>
@@ -386,7 +386,7 @@ Set up Horizon, a server first, without Java on your computer: published tables
<details><summary>Technical</summary>
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)).
</details>
@@ -406,7 +406,7 @@ Smoother hosting: a real Windows service, a backup before every update, backups
<details><summary>Technical</summary>
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.
</details>
@@ -464,7 +464,7 @@ Mods that add machines: blocks that tick, hold items and have their own menus. T
<details><summary>Technical</summary>
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).
</details>
@@ -486,7 +486,7 @@ Pistons and slime blocks will push players, mobs and items as in vanilla. Today
<details><summary>Technical</summary>
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).
</details>
@@ -506,7 +506,7 @@ Villages and fights behaving as in vanilla: iron golems defending villages, vill
<details><summary>Technical</summary>
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)).
</details>
@@ -516,7 +516,7 @@ Pick the speakers or headphones Horizon plays through, in Music & Sounds.
<details><summary>Technical</summary>
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.
</details>
@@ -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)
</details>
@@ -566,7 +566,7 @@ Builds of the game and the launcher for Macs with an Intel processor.
<details><summary>Technical</summary>
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).
</details>
@@ -576,7 +576,7 @@ Fixes for Linux desktops that use Wayland and Hyprland: fullscreen, the clipboar
<details><summary>Technical</summary>
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.
</details>
@@ -626,7 +626,7 @@ Safer releases: changes to the release machinery need the owner's review, and AI
<details><summary>Technical</summary>
`.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)).
</details>
@@ -636,7 +636,7 @@ Every download Horizon makes is checked against the project's signature, includi
<details><summary>Technical</summary>
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)).
</details>
@@ -650,7 +650,7 @@ Far terrain drawn from the world you really built and explored, caves and builds
<details><summary>Technical</summary>
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).
</details>
@@ -692,7 +692,7 @@ Run Java mods that nobody has rewritten for Horizon yet, through a bridge or a c
<details><summary>Technical</summary>
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.
</details>
@@ -704,7 +704,7 @@ Sign in with other account providers, such as Ely.by or any Yggdrasil-compatible
<details><summary>Technical</summary>
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)).
</details>
@@ -748,7 +748,7 @@ Contraptions and physics like the Create and Aeronautics mods, as a mod for Hori
<details><summary>Technical</summary>
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.
</details>
@@ -790,7 +790,7 @@ Vanilla's complete F3 screen: debug options, a profiler chart, ten-second captur
<details><summary>Technical</summary>
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).
</details>
@@ -814,7 +814,7 @@ An optional ray-tracing mode for graphics cards that support it (RTX and recent
<details><summary>Technical</summary>
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.
</details>
@@ -824,7 +824,7 @@ Output for HDR monitors: brighter highlights and richer colour where your screen
<details><summary>Technical</summary>
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.
</details>
@@ -858,7 +858,7 @@ Game and launcher builds for 64-bit ARM Linux computers.
<details><summary>Technical</summary>
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`).
</details>
@@ -868,7 +868,7 @@ Versions of Horizon for Android, iOS and web browsers. Nothing official yet; con
<details><summary>Technical</summary>
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.
</details>
@@ -912,7 +912,7 @@ An optional AI teammate you can talk to by voice. It plays beside you, helps or
<details><summary>Technical</summary>
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.
</details>
@@ -938,7 +938,7 @@ Run Horizon's built-in benchmark and share the report: every new computer makes
<details><summary>Technical</summary>
`horizon-launcher play --arg=--benchmark --arg=standard` writes a JSON report; `horizon-launcher data benchmark <report>` 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 <report>` 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.
<details><summary>Technical</summary>
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).
</details>
@@ -962,19 +962,19 @@ Armour and tools in End city chests should come enchanted, as in vanilla.
<details><summary>Technical</summary>
`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).
</details>
## 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)
@@ -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):
@@ -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):
+1 -1
View File
@@ -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):
+1 -1
View File
@@ -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 <args>`.
+2 -2
View File
@@ -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 <checkout> --files <dir> --out <index.json> [--release <url>] [--site <url>] [--generated <time>]
cargo horizon-mod registry review <base checkout> <head checkout> --author <login> [--json]
+23
View File
@@ -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
+14
View File
@@ -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;
+2 -2
View File
@@ -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-items = { path = "../horizon-items" }
horizon-core = { path = "../horizon-core" }
@@ -55,7 +56,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 }
@@ -90,7 +90,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"]
+59
View File
@@ -4340,6 +4340,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())
@@ -4624,6 +4632,10 @@ impl Game<'_> {
self.tick_brush(slot, ticks);
return;
}
if info.bundle {
self.tick_bundle(slot, ticks);
return;
}
let Some(consumable) = info.consumable.as_ref() else {
self.using = None;
return;
@@ -4646,6 +4658,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.
+6 -1
View File
@@ -3658,7 +3658,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,
+2 -2
View File
@@ -42,12 +42,12 @@ pub(super) fn player_for(
}
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;
// A tame wolf or cat sees its owner (`TamableAnimal.getOwner`), while they
// A tame wolf, cat or parrot sees its owner (`TamableAnimal.getOwner`), while they
// are in play, whoever is nearer. Not while it targets or was just hurt by
// a player: then `Who::Player` is that attacker, whoever it is, and the
// owner goals ignore it until the wolf lets go.
if !targeting
&& matches!(m.species(), Species::Wolf | Species::Cat)
&& matches!(m.species(), Species::Wolf | Species::Cat | Species::Parrot)
&& m.extra.tame
&& let Some(owner) = m.extra.owner
{
+11
View File
@@ -4910,7 +4910,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;
@@ -5013,6 +5016,14 @@ impl Game<'_> {
self.using = hit.and(Some((slot, elapsed))).filter(|_| elapsed < 200);
return;
}
// 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)) {
+9 -9
View File
@@ -31,7 +31,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;
@@ -73,7 +72,6 @@ pub mod friends_screen;
pub mod furnace;
pub mod game_mode_switcher;
pub mod game_rules_screen;
pub mod gamepad;
pub mod gfx;
pub mod gizmos;
pub mod gossip;
@@ -87,17 +85,12 @@ 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_render;
pub mod item_sync;
pub mod item_tooltip;
pub mod java_text;
pub mod key_names;
pub mod keybinds;
pub mod keymapping;
pub mod lan;
pub mod landing;
pub mod level_loading;
@@ -117,7 +110,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;
@@ -189,7 +181,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;
@@ -205,6 +196,15 @@ 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;
pub use horizon_items::blocks;
pub use horizon_items::bundle;
+1 -1
View File
@@ -13,7 +13,7 @@ use std::{
/// Horizon's registry; `HORIZON_MOD_INDEX` points elsewhere (a local file
/// for trials, whose files may then be `file://`), as for the launcher.
pub const INDEX_URL: &str = "https://ludovic111.github.io/horizon-mods/index.json";
pub const INDEX_URL: &str = "https://horizon-rust.github.io/horizon-mods/index.json";
const MAX_INDEX: u64 = 16 << 20;
/// An extra that is an official mod now.
+1 -1
View File
@@ -11,7 +11,7 @@ use std::{
/// Where the troubleshooting lives (shown to hosts nobody can reach).
pub const HELP_URL: &str =
"https://github.com/ludovic111/horizon/blob/main/docs/play-with-friends.md#troubleshooting";
"https://github.com/horizon-rust/horizon/blob/main/docs/play-with-friends.md#troubleshooting";
#[derive(Clone, Debug)]
pub struct Options {
+3 -1
View File
@@ -50,10 +50,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)
+2 -2
View File
@@ -3,7 +3,7 @@
The service behind the registry's submission form (`playhorizon.dev/mods/submit`). A creator signs in with GitHub and
sends a file with its page; the service runs the file's own checks (`horizon_mods::index::inspect`, the signature, the
entry's fields), uploads it to the `staging` release of
[ludovic111/horizon-mods](https://github.com/ludovic111/horizon-mods) as `<sha256>.<extension>`, and opens a pull
[horizon-rust/horizon-mods](https://github.com/horizon-rust/horizon-mods) as `<sha256>.<extension>`, and opens a pull
request adding or updating `mods/<id>.toml`. That repository's CI checks it again, with a trial run of a mod in the
sandbox; reviewers decide, and merging publishes. Formats and rules: [docs/api/mod-index.md](../../docs/api/mod-index.md).
@@ -43,7 +43,7 @@ REGISTRY_PUBLIC_URL=http://localhost:4173 REGISTRY_SESSION_KEY=... GITHUB_CLIENT
| `REGISTRY_SESSION_KEY` | 32 characters or more, random: signs sessions |
| `GITHUB_CLIENT_ID`, `GITHUB_CLIENT_SECRET` | The OAuth app |
| `GITHUB_BOT_TOKEN` | Fine-grained, the registry repository only: Contents and Pull requests read and write |
| `REGISTRY_REPO` | Default `ludovic111/horizon-mods` |
| `REGISTRY_REPO` | Default `horizon-rust/horizon-mods` |
| `REGISTRY_DB` | The ratings' SQLite file: default `/data/registry.sqlite3`, the volume |
| `PORT` | Default 8080 |
+2 -1
View File
@@ -75,7 +75,8 @@ impl Config {
session_key: key.into_bytes(),
github: GitHub::new(
github::Endpoints::default(),
std::env::var("REGISTRY_REPO").unwrap_or_else(|_| "ludovic111/horizon-mods".into()),
std::env::var("REGISTRY_REPO")
.unwrap_or_else(|_| "horizon-rust/horizon-mods".into()),
var("GITHUB_CLIENT_ID")?,
var("GITHUB_CLIENT_SECRET")?,
var("GITHUB_BOT_TOKEN")?,
+1 -1
View File
@@ -21,7 +21,7 @@ pub const SCHEMA: u32 = 1;
/// The biggest file the registry takes (a `.hmod` with content, a `.hpack`).
pub const MAX_FILE: u64 = 64 << 20;
/// Where files may be downloaded from: the registry's release assets.
pub const FILE_HOST: &str = "https://github.com/ludovic111/horizon-mods/releases/download/";
pub const FILE_HOST: &str = "https://github.com/horizon-rust/horizon-mods/releases/download/";
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct Index {
+1 -1
View File
@@ -1,4 +1,4 @@
//! The registry repository (`ludovic111/horizon-mods`, docs/api/mod-index.md):
//! The registry repository (`horizon-rust/horizon-mods`, docs/api/mod-index.md):
//! one `mods/<id>.toml` per project, written by the submission form or by
//! hand and reviewed in a pull request, plus `revoked.toml`. Its CI turns
//! them into `index.json` with [`build`], reading every listed file, and
@@ -30,7 +30,7 @@ description = "`/where` puts them in chat, `/coords` hides or shows the panel."
authors = ["Horizon"]
owners = ["ludovic111"]
license = "MIT"
source = "https://github.com/ludovic111/horizon/tree/main/crates/horizon-mod-sdk/examples/coords-hud"
source = "https://github.com/horizon-rust/horizon/tree/main/crates/horizon-mod-sdk/examples/coords-hud"
icon = "icons/coords_hud.png"
key = "RWTVtuGb/GRXcBf3Re5hzM07EzoStr2sLTJjghJia0xX15ULoZRFFZDb"
@@ -52,7 +52,7 @@ summary = "Coordinates and a calm render distance."
authors = ["Horizon"]
owners = ["ludovic111"]
license = "MIT"
source = "https://github.com/ludovic111/horizon-mods"
source = "https://github.com/horizon-rust/horizon-mods"
[[versions]]
version = "1.0.0"
@@ -69,7 +69,7 @@ summary = "A post-processing pass over the world."
authors = ["Horizon"]
owners = ["ludovic111"]
license = "MIT"
source = "https://github.com/ludovic111/horizon-mods"
source = "https://github.com/horizon-rust/horizon-mods"
[[versions]]
version = "1.0.0"
@@ -123,7 +123,7 @@ impl Scratch {
registry: &repo,
files: &files,
release: super::super::FILE_HOST,
site: "https://ludovic111.github.io/horizon-mods/",
site: "https://horizon-rust.github.io/horizon-mods/",
generated: "2026-10-24T18:00:00Z".into(),
})
}
+1 -1
View File
@@ -131,7 +131,7 @@ fn refuses_broken_indexes() {
assert!(e.contains("https"), "{e}");
// A local test registry may list files on disk; the published one may not.
let local = text.replace(
"https://github.com/ludovic111/horizon-mods/releases/download/coords_hud-0.1.0/",
"https://github.com/horizon-rust/horizon-mods/releases/download/coords_hud-0.1.0/",
"file:///tmp/",
);
assert!(Index::parse(&local).unwrap_err().contains("https"));
@@ -15,8 +15,8 @@
"ludovic111"
],
"license": "MIT",
"source": "https://github.com/ludovic111/horizon/tree/main/crates/horizon-mod-sdk/examples/coords-hud",
"icon": "https://ludovic111.github.io/horizon-mods/icons/coords_hud.png",
"source": "https://github.com/horizon-rust/horizon/tree/main/crates/horizon-mod-sdk/examples/coords-hud",
"icon": "https://horizon-rust.github.io/horizon-mods/icons/coords_hud.png",
"key": "RWTVtuGb/GRXcBf3Re5hzM07EzoStr2sLTJjghJia0xX15ULoZRFFZDb",
"versions": [
{
@@ -33,7 +33,7 @@
"game": "26.3",
"file": {
"name": "coords_hud-0.1.0.hmod",
"url": "https://github.com/ludovic111/horizon-mods/releases/download/coords_hud-0.1.0/coords_hud-0.1.0.hmod",
"url": "https://github.com/horizon-rust/horizon-mods/releases/download/coords_hud-0.1.0/coords_hud-0.1.0.hmod",
"size": 438,
"sha256": "e1135345692f6dd8fd4c51920151944b82333e17049c9bb7d756f27b8deefc53",
"signature": "untrusted comment: signature from minisign secret key\nRUTVtuGb/GRXcIa5yCyCHFGFt55tj3T/FLUDv3ecNLVNNiQqQu7xyBrfc3wsvMHmudsEq6yr+QF21XN3+hnr/Ged3ULr5rv3zgE=\ntrusted comment: coords_hud 0.1.0\nIESQkJdTzLOvWegcGFxOMrQbnwJp2OKSSxoCKAxdfwyRb+9atdF+Q5/OpbdYurMnrNN1X1ybb43AszPVecdiCw==\n"
@@ -53,7 +53,7 @@
"ludovic111"
],
"license": "MIT",
"source": "https://github.com/ludovic111/horizon-mods",
"source": "https://github.com/horizon-rust/horizon-mods",
"versions": [
{
"version": "1.0.0",
@@ -69,7 +69,7 @@
],
"file": {
"name": "cozy-1.0.0.hpack",
"url": "https://github.com/ludovic111/horizon-mods/releases/download/cozy-1.0.0/cozy-1.0.0.hpack",
"url": "https://github.com/horizon-rust/horizon-mods/releases/download/cozy-1.0.0/cozy-1.0.0.hpack",
"size": 471,
"sha256": "241ac840f9c5ea3f6252d849da10c90d36cb1da4d6cd8d1d268c2760a353cd65"
}
@@ -88,7 +88,7 @@
"ludovic111"
],
"license": "MIT",
"source": "https://github.com/ludovic111/horizon-mods",
"source": "https://github.com/horizon-rust/horizon-mods",
"versions": [
{
"version": "1.0.0",
@@ -97,7 +97,7 @@
"game": "26.3",
"file": {
"name": "glow-1.0.0.hshader",
"url": "https://github.com/ludovic111/horizon-mods/releases/download/glow-1.0.0/glow-1.0.0.hshader",
"url": "https://github.com/horizon-rust/horizon-mods/releases/download/glow-1.0.0/glow-1.0.0.hshader",
"size": 689,
"sha256": "331cfe29a666a0de804e9a9ff3d19d246eebcfbfa70b4f49bba8482d30ad9f02"
}
+1 -1
View File
@@ -7,7 +7,7 @@ use serde_json::Value;
use std::{collections::BTreeMap, path::Path};
const API: &str = "https://api.modrinth.com/v2";
pub(crate) const AGENT: &str = "ludovic111/horizon horizon-port-pack/0.1 (docs/modpacks.md)";
pub(crate) const AGENT: &str = "horizon-rust/horizon horizon-port-pack/0.1 (docs/modpacks.md)";
#[derive(Debug, Default, Serialize, Deserialize)]
pub struct Cache {
+1 -1
View File
@@ -76,7 +76,7 @@ pub fn systemd_unit(program: &Path, dir: &Path, user: Option<&str>) -> String {
format!(
"[Unit]
Description=Horizon server in {dir}
Documentation=https://github.com/ludovic111/horizon/blob/main/docs/server.md
Documentation=https://github.com/horizon-rust/horizon/blob/main/docs/server.md
Wants=network-online.target
After=network-online.target
+1 -1
View File
@@ -13,7 +13,7 @@ use std::{
time::{Duration, Instant},
};
const REPO: &str = "ludovic111/horizon";
const REPO: &str = "horizon-rust/horizon";
/// The release archives for this computer, most specific first: on Linux the server build (no ALSA or
/// udev), else the full game (releases before the server build).
const ASSETS: &[&str] = if cfg!(all(target_os = "linux", target_arch = "x86_64")) {
+2 -2
View File
@@ -30,7 +30,7 @@ The totals are grouped per version, OS, GPU vendor and render distance. Each gro
## Benchmarks summary
`src/summary.rs` makes it with the same rules as the website's `scripts/benchmarks.mjs` (ludovic111/horizon-site), which bakes the page's fallback copy; both are tested against the same fixtures (`tests/fixtures/benchmarks/` here, copied in the site's repository).
`src/summary.rs` makes it with the same rules as the website's `scripts/benchmarks.mjs` (horizon-rust/horizon-site), which bakes the page's fallback copy; both are tested against the same fixtures (`tests/fixtures/benchmarks/` here, copied in the site's repository).
- Only reports that compare: a version 1 `horizon-benchmark-report` of the standard flight over the four scenes, VSync off, no frame cap, on screen, from Horizon or plain vanilla, naming its GPU and CPU.
- A group (GPU, CPU, render distance, game) is published only with **at least 3 different installs**. Each install counts once: the median of its runs, then the median across installs.
@@ -89,7 +89,7 @@ All are environment variables:
- `HORIZON_TELEMETRY_HUB_KEEP_DAYS` (90)
- `HORIZON_TELEMETRY_HUB_TOKEN`: the token Kira reads the suggestions with (unset: `GET /hub/suggestions` is off)
- `HORIZON_TELEMETRY_GITHUB_TOKEN`: a fine-grained token with Issues read and write on the repository only (unset: `POST /hub/report` answers 503 and the form points to GitHub and Discord)
- `HORIZON_TELEMETRY_GITHUB_REPO` (`ludovic111/horizon`)
- `HORIZON_TELEMETRY_GITHUB_REPO` (`horizon-rust/horizon`)
## Hosting
@@ -1,6 +1,6 @@
//! The hardware classes the public output breaks results down by. Coarse on purpose: a class
//! holds many machines, and a published cell still needs `MIN_INSTALLS` different installs.
//! The website's `scripts/benchmarks.mjs` (ludovic111/horizon-site) has the same functions, tested on the same fixtures.
//! The website's `scripts/benchmarks.mjs` (horizon-rust/horizon-site) has the same functions, tested on the same fixtures.
//!
//! The raw values (the exact memory, the driver, the screen) stay in the database for the
//! retention period and are never published.
+1 -1
View File
@@ -99,7 +99,7 @@ impl Default for Config {
hub_keep_days: 90,
hub_token: None,
github_token: None,
github_repo: "ludovic111/horizon".into(),
github_repo: "horizon-rust/horizon".into(),
}
}
}
@@ -1,6 +1,6 @@
//! `GET /v1/benchmarks/summary`: players' benchmark uploads, grouped for the website's Benchmarks page.
//!
//! The same rules as the website's `scripts/benchmarks.mjs` (ludovic111/horizon-site; it builds the page's baked
//! The same rules as the website's `scripts/benchmarks.mjs` (horizon-rust/horizon-site; it builds the page's baked
//! copy), checked against the same fixtures (`tests/fixtures/benchmarks/`, which the site's test keeps a copy of):
//!
//! - Only reports that compare: `horizon-benchmark-report` version 1, kind `game`, Horizon or plain vanilla, the
@@ -1,7 +1,7 @@
# Benchmark summary fixtures
Used by the telemetry server's `GET /v1/benchmarks/summary` test (`tests/summary.rs`) and, as a copy, by the
website's aggregator test (`scripts/benchmarks.test.mjs` in ludovic111/horizon-site, which checks its copy against
website's aggregator test (`scripts/benchmarks.test.mjs` in horizon-rust/horizon-site, which checks its copy against
this one on main): the same `benchmark` items in, the same groups out. Change both together.
- `items.jsonl`: one stored item per line (`install_id`, `day`, `version`, `data`: a benchmark report). Group
+2 -2
View File
@@ -42,7 +42,7 @@ fn hub(config: Config) -> Hub {
labels: issue.labels.clone(),
});
Ok(format!(
"https://github.com/ludovic111/horizon/issues/{}",
"https://github.com/horizon-rust/horizon/issues/{}",
1000 + opened.len()
))
});
@@ -156,7 +156,7 @@ async fn a_report_becomes_an_issue_in_the_bug_template() {
assert_eq!(code, StatusCode::CREATED);
assert_eq!(
body["issue"],
"https://github.com/ludovic111/horizon/issues/1001"
"https://github.com/horizon-rust/horizon/issues/1001"
);
let issue = hub.github.opened.lock().unwrap().remove(0);
assert_eq!(issue.title, "Water is black on AMD");
@@ -1,5 +1,5 @@
//! `GET /v1/benchmarks/summary` against the shared fixtures (tests/fixtures/benchmarks/): the same uploads must
//! give the groups the website's `scripts/benchmarks.mjs` (ludovic111/horizon-site) gives on its copy of them.
//! give the groups the website's `scripts/benchmarks.mjs` (horizon-rust/horizon-site) gives on its copy of them.
use std::sync::Arc;
use std::sync::atomic::AtomicU32;
+1 -1
View File
@@ -53,4 +53,4 @@ Every page has the same parts: **Overview** (what you can build), **Guide** (whe
The website shows these pages at [playhorizon.dev/docs/api](https://playhorizon.dev/docs/api), built from this
folder, and a summary for players and authors at [playhorizon.dev/docs/apis](https://playhorizon.dev/docs/apis)
(in the website's repository, ludovic111/horizon-site).
(in the website's repository, horizon-rust/horizon-site).
+4 -4
View File
@@ -2,7 +2,7 @@
Horizon's registry lists what is made for Horizon and reviewed: mods (`.hmod`), modpacks (`.hpack`), resource packs
and Horizon shader packs (`.hshader`, [shaders.md](../shaders.md)). Submissions are pull requests in
[ludovic111/horizon-mods](https://github.com/ludovic111/horizon-mods); merging one publishes it. The launcher and the
[horizon-rust/horizon-mods](https://github.com/horizon-rust/horizon-mods); merging one publishes it. The launcher and the
website read one file, `index.json`, which that repository's CI builds. The Rust types and every check below are
`horizon_mods::index` and `horizon_mods::modpack` (feature `index`); the sample is
`crates/horizon-mods/tests/index/index-v1.json`, read by the tests with the files it lists.
@@ -22,7 +22,7 @@ Level: preview ([stability.md](stability.md)). Schema 1.
"versions": [{
"version": "0.1.0", "published": "2026-10-24", "changelog": "",
"api": "0.1", "side": "client", "capabilities": ["game-read", "hud", "chat"], "api_level": 0, "game": "26.3",
"file": { "name": "coords_hud-0.1.0.hmod", "url": "https://github.com/ludovic111/horizon-mods/releases/download/...",
"file": { "name": "coords_hud-0.1.0.hmod", "url": "https://github.com/horizon-rust/horizon-mods/releases/download/...",
"size": 438, "sha256": "e113...", "signature": "untrusted comment: ...\n...\ntrusted comment: ...\n...\n" }
}]
}],
@@ -96,7 +96,7 @@ them into the profile's game folder.
## The registry repository
[ludovic111/horizon-mods](https://github.com/ludovic111/horizon-mods) holds one `mods/<id>.toml` per project, written by
[horizon-rust/horizon-mods](https://github.com/horizon-rust/horizon-mods) holds one `mods/<id>.toml` per project, written by
the submission form or by hand, and `revoked.toml`. What an entry can't vouch for is read from its file by the kind's
own check (`index::inspect`): a mod's API, side and capabilities, a modpack's mods, the size. Types and rules:
`horizon_mods::index::registry`.
@@ -154,7 +154,7 @@ How the repository runs (its workflows are in `.github/workflows/`):
body's `<!-- submitted-by: … -->` line.
- **Merging** needs the `check` run and a CODEOWNER's review. `publish.yml` then makes each new version a release
`<id>-<version>` and deploys `index.json` and `icons/` to GitHub Pages:
`https://ludovic111.github.io/horizon-mods/index.json`, served with `Access-Control-Allow-Origin: *`.
`https://horizon-rust.github.io/horizon-mods/index.json`, served with `Access-Control-Allow-Origin: *`.
- **Weekly**, `cleanup.yml` deletes staged copies of published files after 7 days and of files no open pull request
lists after 30.
- **Taking a file down** is a pull request adding it to `revoked.toml`. Removing an entry outright (a test, a project
+1 -1
View File
@@ -27,7 +27,7 @@ the player before the mod is turned on, and checked against the component's real
The step-by-step guide, from installing the tools to publishing on the registry, is
[Make a mod](https://playhorizon.dev/docs/make-a-mod) on the website. In short:
1. `rustup target add wasm32-unknown-unknown`, `cargo install --git https://github.com/ludovic111/horizon
1. `rustup target add wasm32-unknown-unknown`, `cargo install --git https://github.com/horizon-rust/horizon
cargo-horizon-mod`, then `cargo horizon-mod new my-mod` ([Making a mod](../mods.md#making-a-mod)).
2. Implement `Mod` for your type, list the capabilities you import in `horizon-mod.toml`
([The manifest](../mods.md#the-manifest)).
+1 -1
View File
@@ -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`,
+1 -1
View File
@@ -140,7 +140,7 @@ Geist (400, 500, 600) and Geist Mono (400), bundled under the SIL Open Font Lice
landscape banner with the hero, the version picker and Play; Mods holds the mod, resource pack
and modpack tabs; Versions and Patch notes are lists of panels; Settings is
grouped panels of rows. Dark by default, Light or System in Settings (Appearance).
- **Website** (ludovic111/horizon-site): the Blocks look below. The same page structure as before (what it
- **Website** (horizon-rust/horizon-site): the Blocks look below. The same page structure as before (what it
is, screenshots, parity, launcher, patch notes, community), headings in Pixelify Sans, lists as
stacks of panels, the stone texture behind the page and Horizon's pixel landscape (a dawn or a
sunset) behind the hero. Light and dark follow the system, with a toggle. A giant wordmark in
+8 -8
View File
@@ -3,7 +3,7 @@
`horizon-server` hosts a Minecraft Java Edition 26.3 server with Horizon's own game as the engine: one native
program, no Java, one settings file, a command line, and a web panel. Vanilla 26.3 clients and Horizon clients
can join it. This page covers what works on `main` today and says plainly what doesn't yet. The design and the
plan are in [docs/server.md](https://github.com/ludovic111/horizon/blob/main/docs/server.md).
plan are in [docs/server.md](https://github.com/horizon-rust/horizon/blob/main/docs/server.md).
## Before you start
@@ -19,7 +19,7 @@ plan are in [docs/server.md](https://github.com/ludovic111/horizon/blob/main/doc
takes the account's UUID when someone owns that name, as vanilla does, and that player is then refused.
- **Horizon's own client can't sign in to a Microsoft account yet.** That needs an Azure app registration and
Mojang's approval, which the project doesn't have
([docs/microsoft-account.md](https://github.com/ludovic111/horizon/blob/main/docs/microsoft-account.md)).
([docs/microsoft-account.md](https://github.com/horizon-rust/horizon/blob/main/docs/microsoft-account.md)).
Until then Horizon players can join offline servers only (`online_mode = false`). An offline server never
checks accounts: anyone who reaches it can join under any name. Keep it on your LAN or a tailnet
(Tailscale, ZeroTier), or share it only with friends you trust.
@@ -44,13 +44,13 @@ plan are in [docs/server.md](https://github.com/ludovic111/horizon/blob/main/doc
Linux (x86-64) and macOS (Apple Silicon):
```sh
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
```
Windows (x64), in PowerShell:
```powershell
irm https://raw.githubusercontent.com/ludovic111/horizon/main/packaging/server/install.ps1 | iex
irm https://raw.githubusercontent.com/horizon-rust/horizon/main/packaging/server/install.ps1 | iex
```
The script downloads the latest Horizon release for your computer from GitHub, checks it against the SHA-256
@@ -311,7 +311,7 @@ No image is published: build one from the repository. The image holds none of Mi
folder you prepared (step 2) read-only.
```sh
git clone https://github.com/ludovic111/horizon && cd horizon
git clone https://github.com/horizon-rust/horizon && cd horizon
docker build -f packaging/server/Dockerfile -t horizon-server .
docker run -d --name horizon -p 25565:25565 --stop-timeout 180 \
@@ -336,10 +336,10 @@ docker run -d --name horizon -p 25565:25565 --stop-timeout 180 \
## 10. How fast is it
The latest bot benchmark compares Horizon with vanilla 26.3, Paper and Fabric + Lithium:
[benchmarks/server-four-way-2026-10-19](https://github.com/ludovic111/horizon/blob/main/benchmarks/server-four-way-2026-10-19/README.md).
[benchmarks/server-four-way-2026-10-19](https://github.com/horizon-rust/horizon/blob/main/benchmarks/server-four-way-2026-10-19/README.md).
It ran release v2026.10.19 on a 4-thread laptop CPU (i7-7500U), with 1 to 50 players walking, exploring and
standing around spawn, the bots on another machine. All four servers did the same work. Earlier
measurements are in [docs/server.md](https://github.com/ludovic111/horizon/blob/main/docs/server.md). In
measurements are in [docs/server.md](https://github.com/horizon-rust/horizon/blob/main/docs/server.md). In
short:
- **Memory:** 0.7 GB with one player and 1.1 GB with 50, against 3.4 to 4.5 GB for the Java servers
@@ -366,4 +366,4 @@ For more than 50 active players, give it more cores.
open in your firewall. On a tailnet, use the server's tailnet address.
- **It keeps restarting**: `horizon-server status` shows the last crash and `horizon-server logs -n 200` the log
before it. Crash reports are in `crash-reports/`.
- Report problems at <https://github.com/ludovic111/horizon/issues>, with the end of the log.
- Report problems at <https://github.com/horizon-rust/horizon/issues>, with the end of the log.
+4 -4
View File
@@ -21,8 +21,8 @@ Not every line is read by a person. Instead, every change is checked against the
## Why it's safe to run
- **Open source.** All of the code is public on [GitHub](https://github.com/ludovic111/horizon), under the MIT licence.
- **Built from the public code.** Releases are built by GitHub Actions, the build service of GitHub, from the public source. Linux and Windows are built on GitHub's machines, and macOS on Ludovic's Mac mini, which runs GitHub Actions jobs. Every build log is [public](https://github.com/ludovic111/horizon/actions/workflows/release.yml).
- **Open source.** All of the code is public on [GitHub](https://github.com/horizon-rust/horizon), under the MIT licence.
- **Built from the public code.** Releases are built by GitHub Actions, the build service of GitHub, from the public source. Linux and Windows are built on GitHub's machines, and macOS on Ludovic's Mac mini, which runs GitHub Actions jobs. Every build log is [public](https://github.com/horizon-rust/horizon/actions/workflows/release.yml).
- **Signed checksums.** Every release has a `SHA256SUMS` file, a fingerprint of each download, and `SHA256SUMS.sig`, a signature of that list made with Horizon's release key, which only release builds from main can use. The launcher and `horizon-server update` check both before they install anything, and refuse a file that does not match. The very first server install with `install.sh` checks the fingerprint but not the signature.
- **Not yet signed by Apple or Microsoft.** The macOS app is not notarized by Apple, because it is not signed with a paid Apple developer account, so macOS asks you to confirm the first time ([Install](https://playhorizon.dev/docs/install#download-the-launcher) shows how). The Windows programs are not code-signed either, so Windows may warn you too.
- **Mods run in a sandbox.** Horizon mods are WebAssembly programs with no access to your files, the network or other programs. A mod lists what it needs, you see that list before you turn it on, and it can do nothing else. See [Mods](mods.md).
@@ -31,11 +31,11 @@ Not every line is read by a person. Instead, every change is checked against the
## What it doesn't contain
- **No Minecraft files.** Horizon contains no Minecraft code, assets or data, and never downloads them. The launcher builds the game files on your computer from your own copy of Minecraft: Java Edition 26.3. A check that runs on every pull request (`tools/check_public_tree.py`) keeps game files and decompiled code out of the repository and its history.
- **No code from other mods.** Since 24 October 2026, Horizon's code may only be written from Minecraft 26.3 itself and public documentation, never from another mod, loader or renderer ([the rule](../CONTRIBUTING.md#only-original-code)). That day shader packs were removed ([#1561](https://github.com/ludovic111/horizon/pull/1561)), after a developer of Iris showed that our shader pack code had been written from Iris's source. They are being written again from a description of the pack format only.
- **No code from other mods.** Since 24 October 2026, Horizon's code may only be written from Minecraft 26.3 itself and public documentation, never from another mod, loader or renderer ([the rule](../CONTRIBUTING.md#only-original-code)). That day shader packs were removed ([#1561](https://github.com/horizon-rust/horizon/pull/1561)), after a developer of Iris showed that our shader pack code had been written from Iris's source. They are being written again from a description of the pack format only.
## Check it yourself
- **Read the code and its checks.** [The source](https://github.com/ludovic111/horizon), [the checks on every pull request](https://github.com/ludovic111/horizon/actions/workflows/ci.yml) and [the release builds](https://github.com/ludovic111/horizon/actions/workflows/release.yml).
- **Read the code and its checks.** [The source](https://github.com/horizon-rust/horizon), [the checks on every pull request](https://github.com/horizon-rust/horizon/actions/workflows/ci.yml) and [the release builds](https://github.com/horizon-rust/horizon/actions/workflows/release.yml).
- **Compare the fingerprints.** Put a release's files and its `SHA256SUMS` in one folder and run `sha256sum -c SHA256SUMS --ignore-missing` (on macOS `shasum -a 256 -c SHA256SUMS --ignore-missing`, on Windows `Get-FileHash <file>` in PowerShell). Each file should say `OK`.
- **Check the signature.** Download a whole release into a folder, then from a clone of the repository run `cargo run -p horizon-release-sign -- verify --tag <tag> <folder>`. The public key is in `crates/horizon-release-sign/release-keys.txt`.
- **Build it yourself.** The README explains how to [build from source](../README.md#build-from-source).
+2 -1
View File
@@ -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`.
+19 -2
View File
@@ -28,7 +28,7 @@ no Microsoft sign-in"); release builds have it.
`api.minecraftservices.com/authentication/login_with_xbox` (HTTP 403, "Invalid app registration")
until Mojang approves them. Apply with the form linked from https://aka.ms/mce-reviewappid
(Minecraft Java "App ID review"), giving the client ID above, the app name, the project URL
(https://github.com/ludovic111/horizon) and a short description ("open-source Minecraft Java
(https://github.com/horizon-rust/horizon) and a short description ("open-source Minecraft Java
Edition client written in Rust; signs players in to join online-mode servers"). Approval takes
days to weeks; sign-in fails at the Minecraft step with "This app is not approved by Mojang yet"
until then.
@@ -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
@@ -88,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
@@ -100,7 +116,8 @@ one is selected. "Sign out" deletes the account's secrets from the keychain.
ownership answer) 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 `<uuid>`, `<uuid>.1`, `<uuid>.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
+1 -1
View File
@@ -161,7 +161,7 @@ horizon-launcher mods remove faithful-32x
## Sources
**Horizon's registry.** Mods (`.hmod`), modpacks (`.hpack`), resource packs and shader packs (`.hshader`) made for Horizon, reviewed as pull requests in
[ludovic111/horizon-mods](https://github.com/ludovic111/horizon-mods) ([api/mod-index.md](api/mod-index.md)). The
[horizon-rust/horizon-mods](https://github.com/horizon-rust/horizon-mods) ([api/mod-index.md](api/mod-index.md)). The
launcher reads its `index.json` (`browser/horizon.rs`; `HORIZON_MOD_INDEX=<file or https address>` reads a test
registry instead, whose files may then be on disk) at most every ten minutes, and keeps the last copy in
`mod-browser/horizon-index.json`. Before a result is installed it shows whether its files are signed and, for a mod,
+3 -3
View File
@@ -219,7 +219,7 @@ Benchmarks (`--benchmark`) never load mods.
```sh
rustup target add wasm32-unknown-unknown
cargo install --git https://github.com/ludovic111/horizon cargo-horizon-mod
cargo install --git https://github.com/horizon-rust/horizon cargo-horizon-mod
cargo horizon-mod new my-mod # Cargo.toml, horizon-mod.toml, src/lib.rs, tests/hello.toml
# (--template content: a content mod, no code)
cd my-mod
@@ -581,7 +581,7 @@ published. Players find them at [playhorizon.dev/mods](https://playhorizon.dev/m
public profile) and fill in the page: the file, its name and summary, licence, source address, and optionally a
minisign public key with the file's `.minisig`.
4. The form checks the file again and opens a pull request in
[ludovic111/horizon-mods](https://github.com/ludovic111/horizon-mods) that adds `mods/<id>.toml`, with you as its
[horizon-rust/horizon-mods](https://github.com/horizon-rust/horizon-mods) that adds `mods/<id>.toml`, with you as its
owner. That repository's checks run the file in the sandbox and post their report on the pull request; answer the
reviewers there.
5. A reviewer merges it: within minutes the file is a release of horizon-mods, and the project is on the site and in
@@ -663,7 +663,7 @@ so the same rustc and `Cargo.lock` give the same file.
key, so an update signed by another key is refused. Unsigned local files
stay allowed, with an "unsigned" mark on the Mods page.
- **Where mods come from.** Horizon's registry ([Publish your mod](#publish-your-mod)): reviewed pull requests in
[ludovic111/horizon-mods](https://github.com/ludovic111/horizon-mods), files as its release assets, and an
[horizon-rust/horizon-mods](https://github.com/horizon-rust/horizon-mods), files as its release assets, and an
`index.json` on GitHub Pages that the launcher and the website read. A file the registry takes down
(`revoked.toml`) is refused by the launcher and turned off where installed.
- **The launcher.** A Mods tab per installation: browse and search the index,
+32 -6
View File
@@ -127,7 +127,7 @@ parallel, and main's own `checks` run catches the rare semantic conflict.
`parity` becomes required once it has run green on pull requests for a while (a week without a false failure):
```sh
gh api -X POST repos/ludovic111/horizon/branches/main/protection/required_status_checks/contexts -f 'contexts[]=parity / parity'
gh api -X POST repos/horizon-rust/horizon/branches/main/protection/required_status_checks/contexts -f 'contexts[]=parity / parity'
```
A skipped `parity` (a fork's pull request without the label) counts as passed, so requiring it never blocks a
@@ -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: <action>, 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,
@@ -522,4 +548,4 @@ Releases ship often, so nothing they leave behind may grow without bound.
stops its own harnesses on SIGTERM and SIGHUP (a cancelled job), so these come only from a SIGKILL or a harness run
by hand. Runner builds go through the machine's sccache (`tools/ci/runner-env.sh`), so what it removes
comes back from the cache. Update the copy after changing the script:
`ssh macmini 'curl -fsSL https://raw.githubusercontent.com/ludovic111/horizon/main/tools/ci/runner-gc.sh -o ~/.actions-runners/runner-gc.sh'`.
`ssh macmini 'curl -fsSL https://raw.githubusercontent.com/horizon-rust/horizon/main/tools/ci/runner-gc.sh -o ~/.actions-runners/runner-gc.sh'`.
+1 -1
View File
@@ -7,7 +7,7 @@ Horizon started as a decompilation and optimization lab. This page describes the
Game JARs, decompiled Java, libraries, inventories, worlds and logs live **inside this checkout** under gitignored **`.local/`**. No game code is in Git history or release downloads. Fresh clones rebuild the inspection workspace from your own copy of the game (see [Build from source](../README.md#build-from-source)); nothing of the game is downloaded.
```sh
git clone https://github.com/ludovic111/horizon.git
git clone https://github.com/horizon-rust/horizon.git
cd horizon
git config core.hooksPath .githooks
python3 tools/lab.py prepare --server-jar ~/Downloads/server.jar
+6 -6
View File
@@ -85,12 +85,12 @@ shaders, the missing pieces are missing vanilla features too, and each vanilla p
| --- | --- | --- |
| Animation `interpolate` | small | fix PR (`gfx.rs` `animate_sprites`) |
| GUI scaling `width`/`height`, `stretch_inner`, `tile`, `stretch` | small | next fix PR (`ui.rs`) |
| Villager hats | small | [#334](https://github.com/ludovic111/horizon/issues/334) |
| `blur`/`clamp` from packs | small | [#335](https://github.com/ludovic111/horizon/issues/335) |
| Text component fonts, TrueType fonts | medium | [#336](https://github.com/ludovic111/horizon/issues/336) |
| Trims on worn armour (paletted textures) | medium | [#337](https://github.com/ludovic111/horizon/issues/337) |
| Credits and end poem screen | medium | [#338](https://github.com/ludovic111/horizon/issues/338) |
| Locator bar | medium | [#339](https://github.com/ludovic111/horizon/issues/339) |
| Villager hats | small | [#334](https://github.com/horizon-rust/horizon/issues/334) |
| `blur`/`clamp` from packs | small | [#335](https://github.com/horizon-rust/horizon/issues/335) |
| Text component fonts, TrueType fonts | medium | [#336](https://github.com/horizon-rust/horizon/issues/336) |
| Trims on worn armour (paletted textures) | medium | [#337](https://github.com/horizon-rust/horizon/issues/337) |
| Credits and end poem screen | medium | [#338](https://github.com/horizon-rust/horizon/issues/338) |
| Locator bar | medium | [#339](https://github.com/horizon-rust/horizon/issues/339) |
| Post effects and core shaders | large | none yet |
## Testing a pack
+2 -2
View File
@@ -191,7 +191,7 @@ comes out of the headless-engine work.
**One-command install** (`packaging/server/`):
- Linux and macOS:
`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`
The script picks the release archive for the OS and architecture (on Linux x86_64 the server archive,
on macOS arm64 the game's), downloads it from GitHub Releases, and checks it against the SHA-256 GitHub
publishes for each asset. It never asks for sudo. Options: `--version vX.Y.Z`, `--dir` (default
@@ -203,7 +203,7 @@ comes out of the headless-engine work.
any that are missing, `init` warns, and `run` stops at once with what to install, rather than restarting
a game that can't load.
- Windows:
`irm https://raw.githubusercontent.com/ludovic111/horizon/main/packaging/server/install.ps1 | iex`
`irm https://raw.githubusercontent.com/horizon-rust/horizon/main/packaging/server/install.ps1 | iex`
The script does the same into `%LOCALAPPDATA%\Horizon` (`-Version`, `-Dir`), with junctions instead of
links (no admin rights), and adds `bin` to the user's PATH.
- **Layout.** Each release goes to `<dir>/releases/<tag>` and `<dir>/current` points at the one in use, so an
+1 -1
View File
@@ -2,7 +2,7 @@
The upstream PR contains only the surface change and tests, reapplied to upstream main. The measurements below were collected with #796 present; they are historical incremental measurements, not new timings for the rebased upstream head.
This surface-only change is based on the bulk unary density optimization in [upstream PR #796](https://github.com/ludovic111/horizon/pull/796). Measurements compare against `eb3789038e3184c98a1459fe638947200217d360`, which already includes that optimization; its savings are not counted again.
This surface-only change is based on the bulk unary density optimization in [upstream PR #796](https://github.com/horizon-rust/horizon/pull/796). Measurements compare against `eb3789038e3184c98a1459fe638947200217d360`, which already includes that optimization; its savings are not counted again.
With one worker, primary initialized Overworld terrain time improved from 10.664 to 10.298 ms/input chunk (3.43%). Terrain plus decoration improved from 12.645 to 12.242 (3.19%). With four workers, terrain improved 2.48% and combined time 2.07%. Nether terrain improved 4.16% / 3.93% with one/four workers; combined improved 3.76% / 3.63%. The second Overworld site improved terrain 2.53% / 2.81%. End improved 2.95% with one worker but regressed 2.93% with four, with substantial paired noise. This meets the revised 3% median gate on selected representative cases, not the original 5% gate or every workload.
+1 -1
View File
@@ -96,7 +96,7 @@ The launcher reads it when it opens and every minute after, and shows "N playing
- `GET /v1/benchmarks/summary`: players' benchmark uploads grouped by GPU, CPU, render distance and game for playhorizon.dev/benchmarks. A group shows only with at least 3 different installs, and only its medians and counts: no install ID, day, OS version, driver, exact memory or screen. Uploads are never published one by one. Each group's `breakdowns` count its installs per hardware class.
- `POST /v1/live` and `GET /v1/live`: the "I'm playing" ping and the live count.
Public output never holds a raw hardware value, only these classes (`src/classes.rs`, the same in the website's `scripts/benchmarks.mjs`, ludovic111/horizon-site), and a class is published only with at least 3 different installs:
Public output never holds a raw hardware value, only these classes (`src/classes.rs`, the same in the website's `scripts/benchmarks.mjs`, horizon-rust/horizon-site), and a class is published only with at least 3 different installs:
| Breakdown | Classes |
|---|---|
+3 -3
View File
@@ -307,13 +307,13 @@ To turn it on, on the Mac mini (as Ludovic, once approved):
```sh
# 1. The label publish files issues under (once):
gh label create version-port --repo ludovic111/horizon --color 5319e7 \
gh label create version-port --repo horizon-rust/horizon --color 5319e7 \
--description "Work to port Horizon to a new Minecraft release (tools/version_port.py publish)"
# 2. The script, as a copy from main (it updates its own worktree, so it never runs from a checkout):
curl -fsSL https://raw.githubusercontent.com/ludovic111/horizon/main/tools/ci/version-port-daily.sh \
curl -fsSL https://raw.githubusercontent.com/horizon-rust/horizon/main/tools/ci/version-port-daily.sh \
-o ~/code/horizon-parity/version-port-daily.sh
# 3. The agent:
curl -fsSL https://raw.githubusercontent.com/ludovic111/horizon/main/tools/ci/dev.horizon.version-port.plist \
curl -fsSL https://raw.githubusercontent.com/horizon-rust/horizon/main/tools/ci/dev.horizon.version-port.plist \
| sed "s|@HOME@|$HOME|g" > ~/Library/LaunchAgents/dev.horizon.version-port.plist
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/dev.horizon.version-port.plist
# A run now, to see it work (log: ~/Library/Logs/horizon-version-port.log):
+2 -2
View File
@@ -44,7 +44,7 @@ A tag is a 0.2 tag when it is `v` or `launcher@` followed by exactly three numbe
major below 1000; a date's first number is a year, so `v2026.10.21` never is. The rule is written once per
language, with the same tests: `crates/horizon-server/src/update.rs` (`newer`), `launcher/src/backend.rs`
(`release_order`), `tools/release_train.py` (`tag_key`) and
the website's `src/versions.js` (ludovic111/horizon-site).
the website's `src/versions.js` (horizon-rust/horizon-site).
## The workflows
@@ -125,7 +125,7 @@ Run by the orchestrator, in this order. Until step 3, nothing is published.
4. Let the game bridge become stable on its normal schedule: about 6 hours after it was published, the promote run
makes it *latest*. Do not force it (`promote` with `force=true`): it carries about 43 player-facing pull requests
from the freeze and needs its beta like any release. Check it is *latest*:
`gh api repos/ludovic111/horizon/releases/latest --jq .tag_name`.
`gh api repos/horizon-rust/horizon/releases/latest --jq .tag_name`.
5. Only then merge the update channels pull request (the launcher's Stable and Alpha, the daily promotion), then
mark the switch pull request (#1132) ready and merge it (`.github/release-line.txt` = `0.2`, and the
docs that talk about 0.2). On the next run, about 10 minutes, the train publishes `v0.2.0` as a beta and
+10 -1
View File
@@ -12,7 +12,7 @@ The opening, then Play ([clip](docs/opening.webm)):
## What it does
- **Versions**: lists the published releases of ludovic111/horizon, installs the build for
- **Versions**: lists the published releases of horizon-rust/horizon, installs the build for
this platform into its own folder, and removes it again.
- **Play**: prepares resources as `PLAY.txt` describes (your launcher's 26.3 install, the
26.3 server jar from that version's own json, and Java 25) and copies its sounds from your
@@ -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
+10 -1
View File
@@ -167,5 +167,14 @@
"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 :",
"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"
}
+10 -1
View File
@@ -167,5 +167,14 @@
"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} в браузере и введите этот код:",
"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": "Отмена"
}
+85 -11
View File
@@ -625,28 +625,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<Option<String>, 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<bool, String> {
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<Option<String>, 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
+30
View File
@@ -509,6 +509,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()));
+36 -13
View File
@@ -9,8 +9,8 @@ use std::process::{Child, ChildStdin, Command, Stdio};
use std::sync::mpsc::Sender;
use std::sync::{Arc, Mutex};
pub const REPO: &str = "ludovic111/horizon";
pub const README_URL: &str = "https://github.com/ludovic111/horizon/blob/main/launcher/README.md";
pub const REPO: &str = "horizon-rust/horizon";
pub const README_URL: &str = "https://github.com/horizon-rust/horizon/blob/main/launcher/README.md";
/// The players' page on connecting an AI agent (the website's docs/agents.md).
pub const AGENT_DOCS_URL: &str = "https://playhorizon.dev/docs/agents";
/// This launcher's version: the release workflow sets `HORIZON_LAUNCHER_VERSION` from the
@@ -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
}
}
}
}
@@ -2625,6 +2644,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)]
+4 -2
View File
@@ -8,11 +8,13 @@ use std::path::{Path, PathBuf};
/// Hosts a file may come from: Modrinth's and CurseForge's file servers, and the release assets
/// of Horizon's registry.
const HOSTS: [&str; 4] = [
const HOSTS: [&str; 5] = [
"https://cdn.modrinth.com/",
"https://edge.forgecdn.net/",
"https://mediafilez.forgecdn.net/",
horizon_mods::index::FILE_HOST,
// The registry's files at their address before the move to horizon-rust (GitHub redirects it).
"https://github.com/ludovic111/horizon-mods/releases/download/",
];
/// Bigger than any pack these sources serve (Modrinth caps uploads at 500 MiB).
const MAX: u64 = 1 << 30;
@@ -27,7 +29,7 @@ pub(super) fn agent(url: &str) -> ureq::Agent {
horizon_port_pack::net::keep("browser", spec.as_deref(), |proxy| {
let builder = ureq::AgentBuilder::new()
.user_agent(&format!(
"ludovic111/horizon horizon-launcher/{} (github.com/ludovic111/horizon)",
"horizon-rust/horizon horizon-launcher/{} (github.com/horizon-rust/horizon)",
crate::backend::VERSION
))
.timeout_connect(std::time::Duration::from_secs(15))
+4 -4
View File
@@ -1,5 +1,5 @@
//! Horizon's own registry (docs/api/mod-index.md): mods, modpacks and resource packs made for
//! Horizon, reviewed as pull requests in ludovic111/horizon-mods. One file lists them all,
//! Horizon, reviewed as pull requests in horizon-rust/horizon-mods. One file lists them all,
//! `index.json`; every download is checked against it before it reaches the game folder
//! (`horizon_mods::index::check_file`: size, SHA-256, the author's signature, the file's own
//! manifest), and files the index says were taken down are refused and turned off.
@@ -14,12 +14,12 @@ use std::path::{Path, PathBuf};
use std::sync::{Arc, Mutex};
use std::time::{Duration, Instant};
/// Where the registry publishes its index (GitHub Pages of ludovic111/horizon-mods).
pub const INDEX_URL: &str = "https://ludovic111.github.io/horizon-mods/index.json";
/// Where the registry publishes its index (GitHub Pages of horizon-rust/horizon-mods).
pub const INDEX_URL: &str = "https://horizon-rust.github.io/horizon-mods/index.json";
/// The registry's pages on the website, `<SITE>/<id>`.
const SITE: &str = "https://playhorizon.dev/mods";
/// The report form of a project.
const REPORT: &str = "https://github.com/ludovic111/horizon-mods/issues/new?template=report.yml";
const REPORT: &str = "https://github.com/horizon-rust/horizon-mods/issues/new?template=report.yml";
/// The loader name the browser gives registry versions, so `support` and `pick` know them.
pub const LOADER: &str = "horizon";
/// How long a fetched index is used before it is fetched again.
+4 -2
View File
@@ -9,11 +9,13 @@ use std::io::Read;
use std::path::{Path, PathBuf};
/// Hosts images may come from.
const HOSTS: [&str; 4] = [
const HOSTS: [&str; 5] = [
"https://cdn.modrinth.com/",
"https://media.forgecdn.net/",
"https://edge.forgecdn.net/",
// Horizon's registry's icons (its GitHub Pages).
// Horizon's registry's icons (its GitHub Pages), and the mirror kept at the address it had
// before the repositories moved to the horizon-rust organization.
"https://horizon-rust.github.io/horizon-mods/",
"https://ludovic111.github.io/horizon-mods/",
];
/// The most an image may weigh before decoding.
+17 -4
View File
@@ -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<PathBuf>,
/// 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<String>,
@@ -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)?,
+96 -14
View File
@@ -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<bool>,
/// 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<String>,
/// 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;
@@ -1011,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
@@ -1030,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) => {
@@ -1088,7 +1101,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();
@@ -2222,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",
@@ -2241,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()
@@ -2301,8 +2360,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(),
@@ -2385,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)
@@ -3201,9 +3280,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 +3986,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.
+70 -15
View File
@@ -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<u64>,
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<PathBuf, String> {
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<Vec<File>, 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<Vec<File>, 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<Vec<u8>, 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)
}
+137 -11
View File
@@ -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<String, Vec<u8>>) {
@@ -28,7 +30,7 @@ fn mojang() -> (Pins, HashMap<String, Vec<u8>>) {
"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::<String>::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();
}
+157
View File
@@ -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<Self>) -> Stateful<Div> {
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)
}
}
+1 -1
View File
@@ -782,7 +782,7 @@ impl Launcher {
self.servers.create = None;
self.go(Page::Play);
if !self.preparing {
self.prepare();
self.prepare(backend::MinecraftFrom::Install);
}
}
},
+1 -1
View File
@@ -79,7 +79,7 @@ mod tests {
let signature = key.sign("v2099.01.01", sums.as_bytes());
// GitHub as it answers for a signed release (any tag: the files are what a replay would serve).
let signed = |url: &str| -> Result<Option<Vec<u8>>, String> {
assert!(url.starts_with("https://github.com/ludovic111/horizon/releases/download/"));
assert!(url.starts_with("https://github.com/horizon-rust/horizon/releases/download/"));
Ok(Some(
if url.ends_with(".sig") {
signature.clone()
+1 -1
View File
@@ -13,7 +13,7 @@ Playing through the Horizon launcher
Downloaded this archive directly?
Get the launcher instead; it installs, prepares and updates Horizon for you:
https://github.com/ludovic111/horizon/releases?q=launcher-v&expanded=true
https://github.com/horizon-rust/horizon/releases?q=launcher-v&expanded=true
More about Horizon: https://playhorizon.dev
To prepare this folder by hand you need Minecraft Java Edition 26.3, played
+2 -2
View File
@@ -1,7 +1,7 @@
# Installs horizon-server (docs/server.md) on Windows: the latest Horizon release, downloaded from GitHub
# Releases and checked against the SHA-256 GitHub publishes for it.
#
# irm https://raw.githubusercontent.com/ludovic111/horizon/main/packaging/server/install.ps1 | iex
# irm https://raw.githubusercontent.com/horizon-rust/horizon/main/packaging/server/install.ps1 | iex
# & ([scriptblock]::Create((irm .../install.ps1))) -Version v0.5.0 -Dir D:\Horizon
#
# Releases go to <Dir>\releases\<version>, <Dir>\current points at the one in use, and <Dir>\bin (added to
@@ -14,7 +14,7 @@ param(
$ErrorActionPreference = "Stop"
$ProgressPreference = "SilentlyContinue"
$Repo = "ludovic111/horizon"
$Repo = "horizon-rust/horizon"
$Asset = "horizon-windows-x64.zip"
if ($env:PROCESSOR_ARCHITECTURE -ne "AMD64") {
throw "No Horizon release for Windows on $env:PROCESSOR_ARCHITECTURE yet: build it from source (docs/server.md)"
+2 -2
View File
@@ -3,7 +3,7 @@
# downloaded from GitHub Releases and checked against the SHA-256 GitHub publishes for it. On Linux that is
# the server build (horizon-server-linux-x86_64.tar.gz), which needs neither ALSA nor udev.
#
# 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
# curl -fsSL .../install.sh | sh -s -- --version v0.5.0 --dir /opt/horizon --bin /usr/local/bin
# sh install.sh --archive horizon-server-linux-x86_64.tar.gz --version mybuild (an archive you have)
#
@@ -13,7 +13,7 @@
# Nothing of Mojang's is downloaded.
set -eu
REPO=ludovic111/horizon
REPO=horizon-rust/horizon
VERSION=latest
DIR="${XDG_DATA_HOME:-$HOME/.local/share}/horizon"
BIN="$HOME/.local/bin"
+1 -1
View File
@@ -63,7 +63,7 @@ or when the file breaks a rule; `python3 tools/roadmap.py check --offline` runs
## The journal
The hub's Journal tab and `https://playhorizon.dev/data/journal.json` are built with each deploy of the website
(`src/hub.js` in ludovic111/horizon-site). The tab shows every game and launcher release with its notes' changes, each placed under
(`src/hub.js` in horizon-rust/horizon-site). The tab shows every game and launcher release with its notes' changes, each placed under
the roadmap item it moves (the pull request's `roadmap:<id>` label, else the item that links it), the merged pull
requests no release has yet, and the weekly summaries above.
+2 -2
View File
@@ -12,7 +12,7 @@ NOW = dt.datetime(2026, 10, 15, 12, 0, tzinfo=dt.timezone.utc)
def pr(number, title="Fix a thing", labels=(), paths=("crates/horizon-client/src/game.rs",), issues=(), author="ludovic111",
merged=dt.timedelta(hours=9)):
return {"number": number, "title": title, "labels": list(labels), "paths": list(paths), "issues": list(issues),
"author": author, "url": f"https://github.com/ludovic111/horizon/pull/{number}", "merged_at": NOW - merged}
"author": author, "url": f"https://github.com/horizon-rust/horizon/pull/{number}", "merged_at": NOW - merged}
class ReleaseTrainTests(unittest.TestCase):
@@ -231,7 +231,7 @@ class ReleaseTrainTests(unittest.TestCase):
# GitHub's latest is a game release: whoever lands on it is sent to the launcher first (#1647).
_, body = train.notes("game", "v0.2.50", [pr(1)], ["- Sound cuts out after an hour."])
self.assertTrue(body.startswith('<h3>Want to play? Download the <a href="https://playhorizon.dev">Horizon launcher'))
self.assertIn('href="https://github.com/ludovic111/horizon/releases?q=launcher&amp;expanded=true"', body)
self.assertIn('href="https://github.com/horizon-rust/horizon/releases?q=launcher&amp;expanded=true"', body)
self.assertNotIn("\n", train.PLAYERS, "one line: one HTML block, which ends at the blank line after it")
self.assertEqual(body.count("playhorizon.dev"), 1, "said once, at the top")
_, body = train.notes("game", "v0.2.51", [], [])
+2 -2
View File
@@ -147,9 +147,9 @@ class Render(unittest.TestCase):
self.assertIn("## Recently shipped", text)
self.assertNotIn("## Later", text)
self.assertIn("- **Fast**: Faster.", text)
self.assertIn("Multiply, not divide ([#10](https://github.com/ludovic111/horizon/issues/10)).", text)
self.assertIn("Multiply, not divide ([#10](https://github.com/horizon-rust/horizon/issues/10)).", text)
# A link the technical text already gives isn't repeated; the others are listed after it.
self.assertIn("More: [#12](https://github.com/ludovic111/horizon/issues/12)", text)
self.assertIn("More: [#12](https://github.com/horizon-rust/horizon/issues/12)", text)
self.assertIn("- **Old** (v0.2.1): Done.", text)
+239
View File
@@ -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/horizon-rust/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()
+1 -1
View File
@@ -20,7 +20,7 @@ import sys
ROOT = Path(__file__).resolve().parents[2]
OUT = ROOT / "crates" / "horizon-release-sign" / "legacy-releases.txt"
REPO = "ludovic111/horizon"
REPO = "horizon-rust/horizon"
HEADER = """\
# Releases published before signing began, with their archives' SHA-256 as GitHub computed them at upload:
# `<tag> <asset> <sha256>` per line, written by tools/ci/legacy_releases.py. The launcher and horizon-server
+2 -2
View File
@@ -20,11 +20,11 @@
# RUNNER_CPUS and RUNNER_MEMORY (GB): the slice's CPU quota and memory cap (default half the threads, two thirds of
# the memory), for a machine that does nothing else. RUNNER_TOKEN: the registration (or, for uninstall, removal)
# token, made with gh on another machine, where gh must not be logged in (a machine someone else also runs):
# RUNNER_TOKEN=$(gh api -X POST repos/ludovic111/horizon/actions/runners/registration-token --jq .token)
# RUNNER_TOKEN=$(gh api -X POST repos/horizon-rust/horizon/actions/runners/registration-token --jq .token)
# Without Nix (Debian, Ubuntu), the packages come from apt (the list in system_packages) and python3.13 from the
# PATH (uv python install 3.13, linked into ~/.local/bin).
set -euo pipefail
repo=ludovic111/horizon
repo=horizon-rust/horizon
dir=$HOME/.actions-runners/horizon
units=${XDG_CONFIG_HOME:-$HOME/.config}/systemd/user
version=2.338.0
+1 -1
View File
@@ -10,7 +10,7 @@
set -euo pipefail
secret=${1:-RELEASE_SIGNING_KEY}
case "$secret" in RELEASE_SIGNING_KEY|RELEASE_SIGNING_KEY_NEXT) ;; *) echo "unknown secret $secret" >&2; exit 2 ;; esac
repo=${GITHUB_REPOSITORY:-ludovic111/horizon}
repo=${GITHUB_REPOSITORY:-horizon-rust/horizon}
cd "$(dirname "$0")/../.."
gh api "repos/$repo/environments/release" > /dev/null || {
echo "The release environment doesn't exist yet: create it first (docs/security.md)." >&2; exit 1; }
+2 -2
View File
@@ -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",
+1 -1
View File
@@ -16,7 +16,7 @@
# tools/ci/protect_pipeline.sh # print the protection it would set, change nothing
# tools/ci/protect_pipeline.sh --apply # set it (needs the maintainer's admin login)
set -euo pipefail
repo=${GITHUB_REPOSITORY:-ludovic111/horizon}
repo=${GITHUB_REPOSITORY:-horizon-rust/horizon}
api="repos/$repo/branches/main/protection"
body=$(gh api "$api" | jq '{
required_status_checks: (.required_status_checks
+270
View File
@@ -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())

Some files were not shown because too many files have changed in this diff Show More