Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts: # crates/horizon-client/src/game/packs.rs
This commit is contained in:
+240
-13
@@ -17,6 +17,8 @@ The contract between Horizon and its mods: the WIT package `horizon:mods@0.1.0`,
|
||||
| `render` | [`render`](#render) | draw on your screen, shake and zoom the camera |
|
||||
| `input` | [`input`](#input) | see the keys you hold and your clicks, take over the use button on its own items and the mouse wheel, and add keys |
|
||||
| `players` | [`players`](#players) | see who is on the server and message them |
|
||||
| `world` | [`world`](#world) | read and change the world's blocks |
|
||||
| `recipes` | [`recipes`](#recipes) | read the game's recipes and items and which recipes you know, place recipes in your crafting grid and, in creative mode, give you items |
|
||||
|
||||
## World `horizon-mod`
|
||||
|
||||
@@ -29,14 +31,14 @@ A client mod: runs in the player's game.
|
||||
|
||||
A server mod (manifest `side = "server"`, `api = "0.3"`, experimental): runs where the world is simulated, on the dedicated server, a LAN host and single player's own server.
|
||||
|
||||
- Imports (what the game offers): `log`, `storage`, `players`
|
||||
- Imports (what the game offers): `log`, `storage`, `players`, `world`
|
||||
- Exports (what the mod provides): `server-events`
|
||||
|
||||
## World `horizon-ui-mod`
|
||||
|
||||
A mod with widgets (capability `ui`): the SDK builds every mod against this world. Mods built for `horizon-mod` alone (no `ui-events` export) still load and simply hear nothing of their widgets.
|
||||
|
||||
- Imports (what the game offers): `ui`, `render`, `input`, `log`, `game`, `chat`, `hud`, `storage`, `command`
|
||||
- Imports (what the game offers): `ui`, `render`, `input`, `recipes`, `browser`, `log`, `game`, `chat`, `hud`, `storage`, `command`
|
||||
- Exports (what the mod provides): `ui-events`, `events`
|
||||
|
||||
## World `ui-host`
|
||||
@@ -53,6 +55,13 @@ The game's side of capability `render` (imports only).
|
||||
- Imports (what the game offers): `render`, `input`
|
||||
- Exports (what the mod provides):
|
||||
|
||||
## World `recipes-host`
|
||||
|
||||
The game's side of capability `recipes` (imports only).
|
||||
|
||||
- Imports (what the game offers): `recipes`, `browser`
|
||||
- Exports (what the mod provides):
|
||||
|
||||
## `log`
|
||||
|
||||
Access: always granted.
|
||||
@@ -461,6 +470,160 @@ What the game calls. Only the hooks `init` asks for are ever called.
|
||||
| `command` | `func(name: string, args: string) -> result<option<string>, string>` | `/name args`: ok(some(text)) is shown as feedback, err(text) in red. |
|
||||
| `chat` | `func(text: string)` | Each chat line the player receives, as plain text. |
|
||||
|
||||
## `recipes`
|
||||
|
||||
Access: capability `recipes`.
|
||||
|
||||
Capability `recipes` (experimental): the recipes and items the game knows, for recipe viewers. In single player and on Horizon's servers they are the world's; on any other server they are vanilla 26.3's (a client is sent no others), while `known` follows that server's book.
|
||||
|
||||
### record `stack`
|
||||
|
||||
An item of `items`, by its index there, with a count and the components it has beyond the item's own, in vanilla's item syntax (`[potion_contents={potion:"minecraft:swiftness"}]`), or "".
|
||||
|
||||
| Field | Type | |
|
||||
| --- | --- | --- |
|
||||
| `item` | `u32` | |
|
||||
| `count` | `u32` | |
|
||||
| `components` | `string` | |
|
||||
|
||||
### enum `kind`
|
||||
|
||||
The station a recipe is made at.
|
||||
|
||||
| Case | |
|
||||
| --- | --- |
|
||||
| `crafting-shaped` | |
|
||||
| `crafting-shapeless` | |
|
||||
| `smelting` | |
|
||||
| `blasting` | |
|
||||
| `smoking` | |
|
||||
| `campfire` | |
|
||||
| `stonecutting` | |
|
||||
| `smithing` | |
|
||||
| `brewing` | |
|
||||
|
||||
### record `recipe`
|
||||
|
||||
| Field | Type | |
|
||||
| --- | --- | --- |
|
||||
| `id` | `string` | `minecraft:oak_planks`. |
|
||||
| `kind` | `kind` | |
|
||||
| `category` | `string` | The recipe book's tab (`crafting_building_blocks`, `furnace_food`), or "". |
|
||||
| `group` | `string` | Recipes the book shows on one button share a group, or "". |
|
||||
| `width` | `u32` | A shaped recipe's grid: `slots` holds its cells row by row. 0 for the other kinds. |
|
||||
| `height` | `u32` | |
|
||||
| `slots` | `list<list<stack>>` | Each slot's stacks, any one of which fits; an empty list is an empty cell. Cooking and stonecutting: the input. Smithing: the template, the base, the addition. Brewing: the bottle, the reagent. |
|
||||
| `results` | `list<stack>` | What it makes; several when that varies (a trim on any armour). |
|
||||
| `cooking-time` | `u32` | Cooking: game ticks and experience; 0 for the other kinds. |
|
||||
| `experience` | `f32` | |
|
||||
| `book-id` | `s32` | The recipe book's id for it (one per way the book shows it), as `known` lists them; -1 for the kinds the book doesn't show (campfire, stonecutting, smithing, brewing). |
|
||||
|
||||
### record `item`
|
||||
|
||||
| Field | Type | |
|
||||
| --- | --- | --- |
|
||||
| `id` | `string` | `minecraft:diamond`, `<mod>:<path>`. |
|
||||
| `name` | `string` | In the player's language. |
|
||||
| `tags` | `list<string>` | Its item tags, without the `#`. |
|
||||
|
||||
| Function | Signature | What it does |
|
||||
| --- | --- | --- |
|
||||
| `items` | `func() -> list<item>` | Every item, in the registry's order: `stack.item` indexes this list. |
|
||||
| `all` | `func() -> list<recipe>` | Every recipe: the book's in its order, then campfire, stonecutting, smithing and brewing. They don't change while a world is open. |
|
||||
| `known` | `func() -> list<s32>` | The `book-id`s of the recipes the player's recipe book holds now. |
|
||||
| `place` | `func(book-id: s32, all: bool) -> result<_, string>` | Places a recipe in the open screen's grid as a click in the recipe book does (`ServerboundPlaceRecipePacket`): the inventory's grid or a crafting table. `all` places as many as the items allow, as with Shift. Refused while no such screen is open, for a recipe the player's book doesn't hold and for one that can't be placed; one missing items shows as a ghost in the grid, as in the book. |
|
||||
| `give` | `func(stack: stack) -> result<_, string>` | Creative mode only: gives the player the stack, as taking it from the creative inventory does (`ServerboundSetCreativeModeSlot`): the selected slot first, then the hotbar, then the inventory. The count is cut to one stack of the item (64, 16 or 1). |
|
||||
|
||||
## `browser`
|
||||
|
||||
Access: not granted by any capability.
|
||||
|
||||
Capability `ui` (experimental): a recipe viewer's panel beside the game's inventory and container screens (not the creative inventory), on the right of the screen. The game draws it with its own widgets and slots, pages it and keeps its search box; the mod says what it holds. The first loaded mod with a panel shows.
|
||||
|
||||
### record `stack`
|
||||
|
||||
An item to show: its id, a count (1 draws none) and its components beyond the item's own, in vanilla's item syntax, or "".
|
||||
|
||||
| Field | Type | |
|
||||
| --- | --- | --- |
|
||||
| `item` | `string` | |
|
||||
| `count` | `u32` | |
|
||||
| `components` | `string` | |
|
||||
|
||||
### record `click`
|
||||
|
||||
A click on an item of the panel, by its index in `set-items`'s list.
|
||||
|
||||
| Field | Type | |
|
||||
| --- | --- | --- |
|
||||
| `index` | `u32` | |
|
||||
| `right` | `bool` | |
|
||||
|
||||
### record `item-key`
|
||||
|
||||
A key the mod registered (`input.register-key`) went down while the pointer was on an item: a slot of the screen's, or the panel's.
|
||||
|
||||
| Field | Type | |
|
||||
| --- | --- | --- |
|
||||
| `key` | `string` | |
|
||||
| `stack` | `stack` | |
|
||||
|
||||
### record `slot-click`
|
||||
|
||||
A click on a slot of a recipe the panel shows (`set-recipes`).
|
||||
|
||||
| Field | Type | |
|
||||
| --- | --- | --- |
|
||||
| `recipe` | `u32` | The recipe's index in `set-recipes`'s list and the slot's in it; the results come after the slots. |
|
||||
| `slot` | `u32` | |
|
||||
| `stack` | `stack` | The stack the slot showed at that moment. |
|
||||
| `right` | `bool` | |
|
||||
|
||||
### variant `event`
|
||||
|
||||
| Case | Payload | |
|
||||
| --- | --- | --- |
|
||||
| `clicked` | `click` | |
|
||||
| `search` | `string` | The search box's text, each time the player changes it. |
|
||||
| `key` | `item-key` | |
|
||||
| `slot-clicked` | `slot-click` | |
|
||||
| `action` | `u32` | The action button of the recipe at this index in `set-recipes`'s list. |
|
||||
| `page` | `u32` | The player turned the recipes' page (`set-recipes`): the index of the first recipe now shown. |
|
||||
| `back` | | The back button of `set-recipes`. |
|
||||
| `tab` | `u32` | The player picked the tab at this index of `set-recipes`' tabs. |
|
||||
|
||||
### enum `layout`
|
||||
|
||||
How the game lays out a recipe of `set-recipes`.
|
||||
|
||||
| Case | |
|
||||
| --- | --- |
|
||||
| `grid` | A crafting grid of `width` x `height` slots, an arrow and the result. |
|
||||
| `cooking` | One input over a flame, an arrow and the result (furnaces, smokers, campfires). |
|
||||
| `single` | One input, an arrow and the result (the stonecutter). |
|
||||
| `smithing` | Template, base and addition, an arrow and the result. |
|
||||
| `brewing` | A potion and an ingredient, an arrow and the result. |
|
||||
|
||||
### record `recipe-view`
|
||||
|
||||
A recipe to show. Each slot, and the result, cycles through its stacks, one a second; an empty slot shows nothing.
|
||||
|
||||
| Field | Type | |
|
||||
| --- | --- | --- |
|
||||
| `layout` | `layout` | |
|
||||
| `width` | `u32` | The grid's size (`grid` only), at most 3 x 3. |
|
||||
| `height` | `u32` | |
|
||||
| `slots` | `list<list<stack>>` | |
|
||||
| `results` | `list<stack>` | |
|
||||
| `note` | `string` | A short line under the recipe (a cooking time), or "". |
|
||||
| `action` | `option<bool>` | The action button beside it: none, enabled, or shown greyed. |
|
||||
|
||||
| Function | Signature | What it does |
|
||||
| --- | --- | --- |
|
||||
| `set-items` | `func(items: list<stack>)` | The panel's items, at most 8192 (an empty list hides the panel). |
|
||||
| `set-recipes` | `func(title: string, tabs: list<stack>, tab: u32, recipes: list<recipe-view>)` | Shows these recipes in the panel instead of its items, as many as fit a page, under `title` and a back button, with a row of `tabs` (each an icon; `tab` is the selected one) between them; an empty list of recipes shows the items again. At most 256 recipes and 16 tabs. |
|
||||
| `poll` | `func() -> list<event>` | What the player did on the panel since the last poll, at most 256 kept. |
|
||||
|
||||
## `players`
|
||||
|
||||
Access: capability `players`.
|
||||
@@ -495,6 +658,27 @@ Capability `players`, server mods only (manifest `api = "0.3"`, experimental): t
|
||||
| `tell` | `func(player: string, text: string) -> bool` | A system message to one player, after the mod's name; false when no player with that id is online. Up to 8 messages per call. |
|
||||
| `broadcast` | `func(text: string)` | A system message to every player and the server's log, after the mod's name. Counts toward the same 8 per call. |
|
||||
|
||||
## `world`
|
||||
|
||||
Access: capability `world`.
|
||||
|
||||
Capability `world`, server mods only (manifest `api = "0.3"`, experimental): the blocks of the server's loaded chunks, and changes to them through the server's own block updates.
|
||||
|
||||
### record `block-change`
|
||||
|
||||
| Field | Type | |
|
||||
| --- | --- | --- |
|
||||
| `x` | `s32` | |
|
||||
| `y` | `s32` | |
|
||||
| `z` | `s32` | |
|
||||
| `state` | `string` | `minecraft:oak_log[axis=y]`; properties left out take the block's defaults, `minecraft:stone` alone is the default state. |
|
||||
|
||||
| Function | Signature | What it does |
|
||||
| --- | --- | --- |
|
||||
| `get-block` | `func(dimension: string, x: s32, y: s32, z: s32) -> option<string>` | The block state at a position in a dimension (`minecraft:overworld`, ...), as `minecraft:oak_log[axis=y]`, as of this call: none where the server has no chunk loaded there. |
|
||||
| `get-biome` | `func(dimension: string, x: s32, y: s32, z: s32) -> option<string>` | The biome at a position (`minecraft:plains`, ...), as the server stores it (one per 4 x 4 x 4 cell): none where no chunk is loaded. |
|
||||
| `set-blocks` | `func(dimension: string, blocks: list<block-change>) -> result<_, string>` | Sets blocks as `/setblock` does: the old block entity removed, neighbours and shapes updated, light, and every player told. Every state is checked now (an error queues nothing); the changes are made in order after this call returns, before that dimension's next tick; one in a chunk not loaded then is skipped. At most 4096 per call. |
|
||||
|
||||
## `server-events`
|
||||
|
||||
Access: exported by the mod: the game calls it.
|
||||
@@ -505,16 +689,6 @@ What the server calls in a server mod (manifest `api = "0.3"`, experimental). On
|
||||
|
||||
`type player = player`
|
||||
|
||||
### record `registration`
|
||||
|
||||
| Field | Type | |
|
||||
| --- | --- | --- |
|
||||
| `commands` | `list<string>` | Commands players may type, without the slash. A name vanilla already uses is refused (vanilla's command runs). |
|
||||
| `tick` | `bool` | Call `tick` every server tick (20 per second). |
|
||||
| `joins` | `bool` | Call `player-joined` and `player-left`. |
|
||||
| `chat` | `bool` | Call `chat` for each chat message a player sends. |
|
||||
| `blocks` | `bool` | Call `block-broken` and `block-placed`. |
|
||||
|
||||
### record `block-pos`
|
||||
|
||||
| Field | Type | |
|
||||
@@ -523,6 +697,59 @@ What the server calls in a server mod (manifest `api = "0.3"`, experimental). On
|
||||
| `y` | `s32` | |
|
||||
| `z` | `s32` | |
|
||||
|
||||
### variant `argument-kind`
|
||||
|
||||
What an argument of a command takes. The server sends each command and its arguments to players' games, whose chat box completes and colours them as vanilla's; the server parses them before the mod's `command` hook gets their values.
|
||||
|
||||
| Case | Payload | |
|
||||
| --- | --- | --- |
|
||||
| `word` | | One word: letters, digits and `_ - . +`. |
|
||||
| `text` | | The rest of the line, spaces included: only last. |
|
||||
| `integer` | `tuple<option<s32>, option<s32>>` | A whole number, within the bounds given. |
|
||||
| `number` | | A number with or without decimals. |
|
||||
| `boolean` | | `true` or `false`. |
|
||||
| `player` | | One online player: a name, or `@s` or `@p` (whoever typed it, as vanilla picks for a player). |
|
||||
| `block-pos` | | A block position: three whole numbers, each one also `~` or `~n`, relative to whoever typed it. |
|
||||
|
||||
### record `argument`
|
||||
|
||||
| Field | Type | |
|
||||
| --- | --- | --- |
|
||||
| `name` | `string` | Shown in the chat box's hint (`<height>`) and the key of its value. |
|
||||
| `kind` | `argument-kind` | |
|
||||
| `optional` | `bool` | Optional arguments come after every required one. |
|
||||
|
||||
### record `server-command`
|
||||
|
||||
| Field | Type | |
|
||||
| --- | --- | --- |
|
||||
| `name` | `string` | Without the slash. A name vanilla already uses is refused (vanilla's command runs). |
|
||||
| `arguments` | `list<argument>` | In order; none: the command takes nothing after its name. Free text is one optional `text` argument. |
|
||||
|
||||
### variant `argument-value`
|
||||
|
||||
An argument's value, parsed as its kind says.
|
||||
|
||||
| Case | Payload | |
|
||||
| --- | --- | --- |
|
||||
| `word` | `string` | |
|
||||
| `text` | `string` | |
|
||||
| `integer` | `s32` | |
|
||||
| `number` | `f64` | |
|
||||
| `boolean` | `bool` | |
|
||||
| `player` | `player` | |
|
||||
| `block-pos` | `block-pos` | |
|
||||
|
||||
### record `registration`
|
||||
|
||||
| Field | Type | |
|
||||
| --- | --- | --- |
|
||||
| `commands` | `list<server-command>` | Commands players may type. |
|
||||
| `tick` | `bool` | Call `tick` every server tick (20 per second). |
|
||||
| `joins` | `bool` | Call `player-joined` and `player-left`. |
|
||||
| `chat` | `bool` | Call `chat` for each chat message a player sends. |
|
||||
| `blocks` | `bool` | Call `block-broken` and `block-placed`. |
|
||||
|
||||
| Function | Signature | What it does |
|
||||
| --- | --- | --- |
|
||||
| `init` | `func() -> result<registration, string>` | Once, after loading. An error keeps the mod off and is logged. |
|
||||
@@ -530,6 +757,6 @@ What the server calls in a server mod (manifest `api = "0.3"`, experimental). On
|
||||
| `player-joined` | `func(player: player)` | A player joined the server; they are in `players.online` already. |
|
||||
| `player-left` | `func(player: player)` | A player left the server; they are no longer in `players.online`. |
|
||||
| `chat` | `func(player: player, text: string)` | A chat message a player sent, as plain text. |
|
||||
| `command` | `func(player: player, name: string, args: string) -> result<option<string>, string>` | `/name args` typed by `player`: ok(some(text)) is their feedback, err(text) their error in red. |
|
||||
| `command` | `func(player: player, name: string, args: string, values: list<tuple<string, argument-value>>) -> result<option<string>, string>` | `/name args` typed by `player`: ok(some(text)) is their feedback, err(text) their error in red. `values` holds each argument given, by name, in order (an optional one left out isn't there); a line that doesn't parse never reaches the mod: the player gets vanilla's error. |
|
||||
| `block-broken` | `func(player: player, pos: block-pos, state: string)` | A player broke the block at `pos` in their dimension: `state` is what was there, as `minecraft:oak_log[axis=y]`. |
|
||||
| `block-placed` | `func(player: player, pos: block-pos, state: string)` | A player placed `state` at `pos` in their dimension. |
|
||||
|
||||
+11
-6
@@ -18,7 +18,7 @@ the player before the mod is turned on, and checked against the component's real
|
||||
| Hooks a mod exports | 5: `init`, `tick`, `frame`, `command`, `chat`; a server mod 8: `init`, `tick`, `player-joined`, `player-left`, `chat`, `command`, `block-broken`, `block-placed` |
|
||||
| Capabilities | 6: `game-read`, `chat`, `hud`, `storage`, `registries`, `players` |
|
||||
| Manifest `api` lines served | 3: `0.1` (code), `0.2` (content), `0.3` (server mods, experimental) |
|
||||
| SDK | the `Mod` trait (5 methods), `Registration` (4 builders), `export_mod!`, log helpers; `server::ServerMod` (8 methods), `server::Registration` (5 builders), `export_server_mod!` |
|
||||
| SDK | the `Mod` trait (5 methods), `Registration` (4 builders), `export_mod!`, log helpers; `server::ServerMod` (8 methods), `server::Registration` (6 builders), `server::Argument`, `server::Args`, `export_server_mod!` |
|
||||
| `cargo horizon-mod` | `new` (templates `code` and `content`), `build`, `run`, `test`, `check` |
|
||||
| Example mods | `coords-hud` (code), `ruby-content` (content), `welcome` (server) |
|
||||
|
||||
@@ -88,11 +88,11 @@ release.
|
||||
What real mods need next, in the order modpacks and servers need it:
|
||||
|
||||
- **More for server mods** (`api = "0.3"`, [Server mods](../mods.md#server-mods-api-03-experimental)): they run
|
||||
on the server thread, a LAN host and the dedicated server today, with joins, chat, commands and players' block
|
||||
breaking and placing; next entity events, game rules, server commands with typed arguments sent to clients'
|
||||
command trees.
|
||||
- **World and blocks**: read blocks, block states and biomes in loaded chunks; change them through the server's block
|
||||
log, so clients and the parity harnesses see vanilla's updates.
|
||||
on the server thread, a LAN host and the dedicated server today, with joins, chat, typed commands in players'
|
||||
command trees, players' block breaking and placing, and `world` (read blocks and biomes, set blocks as `/setblock`
|
||||
does); next entity events, game rules, entity, item and block-state arguments.
|
||||
- **World and blocks**: blocks, block states and biomes are there for server mods (`world`); next block entities,
|
||||
and `world` for client mods (raycasts, single player and LAN hosts).
|
||||
- **Items and inventories**: the player's inventory, held item and open container; item stacks with components.
|
||||
- **Entities**: query and change entities near a position; spawn from a mod's own entity types (data first).
|
||||
- **Block entities and menus**: ticking machines with slots and their screens.
|
||||
@@ -106,6 +106,11 @@ What real mods need next, in the order modpacks and servers need it:
|
||||
|
||||
## Changelog
|
||||
|
||||
- API 0.3: typed server commands: `registration.commands` lists each command's arguments (`argument-kind`: word,
|
||||
text, integer, number, boolean, player, block-pos), sent in players' command trees and parsed by the server;
|
||||
`command` gets their values. SDK `Registration::command_with`, `Argument`, `Args`.
|
||||
- API 0.3: capability `world` (`get-block`, `get-biome`, `set-blocks`); example `beacons`; test scripts' `blocks` and
|
||||
`expect.blocks`.
|
||||
- Server mods run in the game: single player (server thread and in-frame), LAN hosts, the dedicated server.
|
||||
- API 0.3 (server mods, experimental): world `horizon-server-mod`, capability `players`, the `server-events`
|
||||
hooks; SDK `server::ServerMod`; example `welcome`.
|
||||
|
||||
@@ -38,7 +38,7 @@ don't import it); faster, or fixing behaviour to what the reference already says
|
||||
|
||||
A new WIT function doesn't break older mods, but a mod that calls it can't run on a Horizon from before it. So every
|
||||
function the game offers mods has an **API level**, the one it arrived at (`crates/horizon-mods/src/api_level.rs`):
|
||||
level 0 is the contract of Horizon 0.2.67 to 0.2.69, level 1 adds `render.set-minimap` and server mods' `players`, level 2 `game.raycast`, level 3 `command.run-quiet`. A mod needs the level of
|
||||
level 0 is the contract of Horizon 0.2.67 to 0.2.69, level 1 adds `render.set-minimap` and server mods' `players`, level 2 `game.raycast`, level 3 `command.run-quiet`, level 4 server mods' `world`, level 5 `recipes` (`items`, `all`, `known`), level 6 `browser` (`set-items`, `poll`, `set-recipes`) and `recipes.place` and `recipes.give`. A mod needs the level of
|
||||
the newest function it imports (a component imports only the functions it calls). The level is read from the file,
|
||||
never declared:
|
||||
|
||||
@@ -108,7 +108,7 @@ Deprecations and breaking changes are in bold. The release notes of the game rel
|
||||
| Mod API: `render` (HUD shapes, camera shake and zoom; drawn by the game, no mod shaders) | experimental | manifest `experimental = ["render"]` |
|
||||
| Mod API: `input` (claimed items' use, the mod's keys, the mouse wheel) | experimental | manifest `experimental = ["input"]` |
|
||||
| Content mods (`registries`: data-driven blocks and items) | preview | manifest `api = "0.2"` |
|
||||
| Server mods: world `horizon-server-mod`, `players`, `server-events` | experimental | manifest `api = "0.3"` |
|
||||
| Server mods: world `horizon-server-mod`, `players`, `server-events`, `world`, typed `server-command`s | experimental | manifest `api = "0.3"` |
|
||||
| Script mods (Lua run by an interpreter mod, [mods.md](mods.md#ways-in)) | not started | |
|
||||
| `cargo horizon-mod` (`new`, `build`, `run`), `horizon-mod-sdk` | preview | 0.1.0 |
|
||||
| Shader API | not started | |
|
||||
|
||||
@@ -5,8 +5,9 @@ counted only for the game loop because nearly every gameplay change touches it).
|
||||
organised and how to build and test are in [AGENTS.md](../AGENTS.md).
|
||||
|
||||
Paths: `L/` = `crates/horizon-client/src/`, `G/` = `crates/horizon-client/src/game/`, `W/` =
|
||||
`crates/horizon-world/src/`. Checks: a bare name is a harness (`python3 tools/parity.py <name>`, script
|
||||
`tools/test_<name>_parity.py`); `lan_e2e <check>` is `python3 tools/lan_e2e.py --check <check>`.
|
||||
`crates/horizon-world/src/`, `K/` = `crates/horizon-client-core/src/`, `C/` = `crates/horizon-command/src/`.
|
||||
Checks: a bare name is a harness (`python3 tools/parity.py <name>`, script `tools/test_<name>_parity.py`);
|
||||
`lan_e2e <check>` is `python3 tools/lan_e2e.py --check <check>`.
|
||||
|
||||
For the full set of harnesses a file can affect, ask the runner:
|
||||
`printf '%s\n' <paths> > /tmp/p.txt && python3 tools/parity.py --changed-files /tmp/p.txt --list`.
|
||||
@@ -17,7 +18,7 @@ file selects ~103.
|
||||
|---|---|---|---|
|
||||
| 1 | Game loop, tick order, frame pacing (554) | `L/game.rs` (`fn tick`, `fn tick_world`, `fn render`, `about_to_wait`), `L/clock.rs`, `L/window.rs`, `L/spans.rs` | game_loop, frame_limiter, interaction_input, tick |
|
||||
| 2 | Mobs in the game loop, spawning (166) | `G/creatures.rs`, `G/natural_spawning.rs`, `L/mobs/spawning.rs`, `L/mobs/spawn_rules.rs`, `L/mobs/spawn_selection.rs`, `L/mobs/finalize.rs`, `G/spawner.rs`, `G/trial_spawner.rs` | natural_spawn, spawn_rules, finalize_spawn, spawner, trial_spawner, mob_ai |
|
||||
| 3 | World save and load (163) | `L/save.rs`, `G/saving.rs`, `G/persist.rs` (entities), `L/entity_nbt.rs`, `L/block_entity_nbt.rs`, `W/region.rs`, `W/nbt.rs` | save_roundtrip, world_reopen, world, datafix |
|
||||
| 3 | World save and load (163) | `L/save.rs`, `G/saving.rs`, `G/persist.rs` (entities), `L/entity_nbt.rs`, `K/block_entity_nbt.rs`, `W/region.rs`, `W/nbt.rs` | save_roundtrip, world_reopen, world, datafix |
|
||||
| 4 | World generation (153) | `W/worldgen.rs`, `W/worldgen/` (`generator*.rs`, `feature_graph.rs`, `structure/`, `placement/`), `L/vanillagen.rs` | chunk_generation, worldgen, server_world_gen, world_spawn, feature_graph, feature_placement, decoration and the other worldgen harnesses |
|
||||
| 5 | Multiplayer client, packets in (145) | `G/remote.rs` (`fn handle_packet`, `fn tick_remote`), `G/remote_*.rs`, `L/net.rs` | dedicated_server, server_entities, lan_e2e (all) |
|
||||
| 6 | Agent control, horizon-ctl (145) | `L/control.rs`, `L/bin/horizon-ctl/`, `G/control.rs`, `G/agent.rs`, `G/events.rs`, `G/ui_control.rs` | `python3 tools/agent_control_e2e.py`; `cargo test -p horizon-client --bin horizon-ctl` |
|
||||
@@ -32,7 +33,7 @@ file selects ~103.
|
||||
| 15 | Items and item use (96) | `L/items.rs`, `L/item_data.rs`, `G/hand.rs`, `G/consume.rs`, `G/potions.rs`, `L/effects.rs`; game.rs `fn use_hand`, `fn use_item` | use_item_on, item_use, item_use_lifecycle, consumable, consume_effect, status_effect |
|
||||
| 16 | Options and settings screens (93) | `L/options_ui.rs`, `G/options.rs`, `L/settings.rs`, `L/options_file.rs`, `L/graphics_ui.rs`, `L/graphics.rs` | options, toggle_keys |
|
||||
| 17 | HUD, chat, tab list (93) | `L/hud.rs`, `L/hud_layout.rs`, `L/hud_overlays.rs`, `L/chat.rs`, `G/chat.rs`, `L/tab_list.rs`, `L/locator_bar.rs`, `G/locator_bar.rs` | hud, tab_list, locator_bar, chat_screen, secure_chat |
|
||||
| 18 | Command execution (88) | `G/commands.rs`, `G/commands/*.rs`, `L/scoreboard_cmd.rs`, `L/data_cmd.rs`, `G/functions.rs` | command_exec (corpus `tools/command_exec_corpus.py`), scoreboard, server_ops_feedback, lan_e2e commands |
|
||||
| 18 | Command execution (88) | `G/commands.rs`, `G/commands/*.rs`, `L/scoreboard_cmd.rs`, `L/data_cmd.rs`, `K/scoreboard.rs`, `G/functions.rs` | command_exec (corpus `tools/command_exec_corpus.py`), scoreboard, server_ops_feedback, lan_e2e commands |
|
||||
| 19 | Chunk streaming, light, tickets (85) | `L/streaming.rs`, `L/world.rs`, `L/chunk.rs`, `L/chunk_map.rs`, `L/light.rs`, `L/ticket_levels.rs`, `L/tick_chunk_membership.rs`, `G/world_loading.rs` | light, chunk_status, random_tick_sections; `cargo test -p horizon-client --test streaming_meshes` |
|
||||
| 20 | Mob models and animation (78) | `L/mobs/render.rs`, `L/mobs/anim.rs`, `L/mobs/body_anim.rs`, `L/mobs/keyframes.rs`, `L/entity.wgsl` | entity_model |
|
||||
| 21 | Block behaviour, server side (78) | `W/level/` (`mod.rs`, `tick.rs`, `hooks.rs`, `data.rs`, `redstone.rs`, `place.rs`), `G/block_entity_ticks.rs`, `G/moving_pistons.rs` | block_update, redstone, random_tick, simple_block, piston_movement, block_entity_tickers |
|
||||
@@ -46,12 +47,12 @@ file selects ~103.
|
||||
| 29 | Title, worlds, startup (49) | `L/title.rs` + `L/title/`, `G/startup_menu.rs`, `L/title_edition.rs` | world_options; `cargo test -p horizon-client --lib title` |
|
||||
| 30 | Dedicated server, horizon-server (48) | `G/dedicated.rs`, `G/dedicated/status.rs`, `crates/horizon-server/`, `crates/horizon-server-files/` | dedicated_server, server_files, user_cache, online_mode, server_ops_feedback |
|
||||
| 31 | Particles and client effects (46) | `L/particles.rs`, `G/render_tick.rs`, `G/level_particles.rs`, `L/animate_tick.rs` | particle_providers, block_particles, entity_particles, emitter_particles, marker_particles |
|
||||
| 32 | Bosses and the End (45) | `G/dragon.rs`, `G/wither.rs`, `G/end.rs` | server_dragon, end_podium, end_gateway |
|
||||
| 32 | Bosses and the End (45) | `G/dragon.rs`, `G/wither.rs`, `G/end.rs` | server_dragon, forced_end, end_podium, end_gateway |
|
||||
| 33 | Protocol and packets (44) | `crates/horizon-protocol/src/` (`packets/play.rs`, `entity_data.rs`, `connection.rs`) | dedicated_server, online_mode, secure_chat; `cargo test -p horizon-protocol` |
|
||||
| 34 | Multiplayer and LAN screens, friends (44) | `L/multiplayer.rs`, `G/lan_screen.rs`, `G/friends.rs`, `L/friends_screen.rs`, `crates/horizon-friends/`, `crates/horizon-relay/` | lan, world_options; `python3 tools/test_friends.py` |
|
||||
| 35 | Dispensers (43) | `G/dispenser.rs`, `G/dispense_fixture.rs` (the harness side) | dispenser |
|
||||
| 36 | Audio and music (38) | `L/audio.rs`, `L/sound_engine.rs`, `L/sound_events.rs`, `L/music.rs`, `G/music.rs`, `L/ambience.rs`, `G/subtitle_hud.rs` | sound_engine, sound_event, music, situational_music, ambient_sound, subtitle |
|
||||
| 37 | Integrated server and levels (34) | `G/integrated.rs`, `G/levels.rs`, `G/server_travel.rs` | server_dimension_players, `lan_e2e` (server-thread by default; portals, levels, distance, lava) |
|
||||
| 38 | Command parsing (34) | `L/command/` (`args.rs`, `selector.rs`, `tree_*.rs`, `vanilla.rs`) | command_parse (corpus `tools/command_parse_corpus.py`) |
|
||||
| 38 | Command parsing (34) | `C/` (`args.rs`, `selector.rs`, `tree_*.rs`, `vanilla.rs`); `cargo test -p horizon-command` | command_parse (corpus `tools/command_parse_corpus.py`) |
|
||||
| 39 | Benchmarks and telemetry (34) | `L/benchmark.rs`, `tools/perf_bench.py`, `L/telemetry.rs`, `crates/horizon-telemetry*/`, `crates/horizon-bench/` | `python3 -m unittest tests.test_perf_bench`; [benchmark.md](benchmark.md) |
|
||||
| 40 | Explosions and TNT (31) | `G/explosion.rs`, `G/tnt.rs` | lan_e2e blast; no dedicated harness yet |
|
||||
|
||||
+321
-5
@@ -50,9 +50,11 @@ Start the client.
|
||||
|
||||
horizon-launcher play
|
||||
|
||||
- `--instance`: The instance to play (its name or id; default: the selected one)
|
||||
- `--world`: Open or create this world (a folder under saves) at once
|
||||
- `--creative`: Creative mode for a new world
|
||||
- `--join`: Join a friend's world with its invite code
|
||||
- `--server`: Join this server at once: an address, or a server of the list by name or position
|
||||
- `--arg`: An extra argument for the game, passed through as-is (repeatable), for example --server-thread
|
||||
|
||||
MCP: `play`, then the `game_*` tools.
|
||||
@@ -132,11 +134,11 @@ MCP: `account_offline`.
|
||||
|
||||
## `horizon-launcher settings`
|
||||
|
||||
Show the launcher's settings, or set one (the Settings page): selected-version TAG, minecraft-dir PATH, server-dir PATH ("default" resets a folder), install-new-versions on|off, opening-animation on|off, proxy http://host:port ("default" removes it).
|
||||
Show the launcher's settings, or set one (the Settings page): selected-version TAG, minecraft-dir PATH, server-dir PATH ("default" resets a folder), install-new-versions on|off, opening-animation on|off, proxy http://host:port ("default" removes it), while-playing stay|minimize|hide (what the window does while the game runs).
|
||||
|
||||
horizon-launcher settings [KEY] [VALUE]
|
||||
|
||||
- `KEY` (selected-version, minecraft-dir, server-dir, install-new-versions, opening-animation, proxy)
|
||||
- `KEY` (selected-version, minecraft-dir, server-dir, install-new-versions, opening-animation, proxy, while-playing)
|
||||
- `VALUE`: The new value (with KEY)
|
||||
|
||||
MCP: `settings`.
|
||||
@@ -151,6 +153,26 @@ Show or set the extra arguments the game starts with (for example --server-threa
|
||||
|
||||
MCP: `game_args`.
|
||||
|
||||
## `horizon-launcher share-log`
|
||||
|
||||
Upload an instance's latest.log to mclo.gs (a paste service for Minecraft logs) and print its link, for a bug report: only when the player asks. The home folder, the user name and the account names are taken out first; the link expires after 90 days unread.
|
||||
|
||||
horizon-launcher share-log
|
||||
|
||||
- `--instance`: The instance (default: the selected one)
|
||||
|
||||
MCP: `share_log`, only when the player asks.
|
||||
|
||||
## `horizon-launcher unshare-log`
|
||||
|
||||
Delete a log shared with share-log: the "<id>:<token>" it printed.
|
||||
|
||||
horizon-launcher unshare-log <SHARED>
|
||||
|
||||
- `SHARED`
|
||||
|
||||
MCP: `unshare_log`, needs `confirm: true`.
|
||||
|
||||
## `horizon-launcher logs`
|
||||
|
||||
Print the end of the game's log (logs/latest.log in the game folder), or its newest crash report.
|
||||
@@ -257,6 +279,292 @@ Upload a benchmark report (docs/benchmark-report.md); it is printed first.
|
||||
|
||||
MCP: `data_benchmark`, only when the player asks.
|
||||
|
||||
## `horizon-launcher instance list`
|
||||
|
||||
The instances, each with its game folder (* = the one Play starts).
|
||||
|
||||
horizon-launcher instance list
|
||||
|
||||
MCP: `instance_list`.
|
||||
|
||||
## `horizon-launcher instance create`
|
||||
|
||||
Make an instance: empty but for your options and name, or a copy of another one's worlds, options and packs.
|
||||
|
||||
horizon-launcher instance create <NAME>
|
||||
|
||||
- `NAME`
|
||||
- `--copy`: The instance to copy (its name or id)
|
||||
|
||||
MCP: `instance_create`.
|
||||
|
||||
## `horizon-launcher instance rename`
|
||||
|
||||
Rename an instance (its folder stays).
|
||||
|
||||
horizon-launcher instance rename <INSTANCE> <NAME>
|
||||
|
||||
- `INSTANCE`
|
||||
- `NAME`
|
||||
|
||||
MCP: `instance_rename`.
|
||||
|
||||
## `horizon-launcher instance icon`
|
||||
|
||||
Set an instance's icon: a block or item name from your prepared files (grass_block), a colour (#3fa7d6), or none.
|
||||
|
||||
horizon-launcher instance icon <INSTANCE> <ICON>
|
||||
|
||||
- `INSTANCE`
|
||||
- `ICON`
|
||||
|
||||
MCP: `instance_icon`.
|
||||
|
||||
## `horizon-launcher instance group`
|
||||
|
||||
Put an instance in a sidebar group, or take it out with no group.
|
||||
|
||||
horizon-launcher instance group <INSTANCE> [GROUP]
|
||||
|
||||
- `INSTANCE`
|
||||
- `GROUP`
|
||||
|
||||
MCP: `instance_group`.
|
||||
|
||||
## `horizon-launcher instance select`
|
||||
|
||||
Make Play start this instance.
|
||||
|
||||
horizon-launcher instance select <INSTANCE>
|
||||
|
||||
- `INSTANCE`
|
||||
|
||||
MCP: `instance_select`.
|
||||
|
||||
## `horizon-launcher instance version`
|
||||
|
||||
Keep an instance on one installed Horizon version, or "latest" to follow updates again.
|
||||
|
||||
horizon-launcher instance version <INSTANCE> <VERSION>
|
||||
|
||||
- `INSTANCE`
|
||||
|
||||
MCP: `instance_version`.
|
||||
|
||||
## `horizon-launcher instance export`
|
||||
|
||||
Export an instance (or a port) to share: its settings, packs, Horizon mods and the worlds named, as a .mrpack (resource packs from Modrinth listed by download) or a zip. Never logs, screenshots or account data; worlds go without their per-player files.
|
||||
|
||||
horizon-launcher instance export [INSTANCE]
|
||||
|
||||
- `INSTANCE`: The instance (default: the selected one)
|
||||
- `--format` (mrpack, zip)
|
||||
- `--world`: A world to put in it (its name or folder); repeat for more
|
||||
- `--out`: Where to write it (default: "<name>.mrpack" in the current folder)
|
||||
|
||||
MCP: `instance_export`.
|
||||
|
||||
## `horizon-launcher instance import`
|
||||
|
||||
Import what a file is, as dropping it on the window does: a shared instance (a .mrpack without mod loaders, such as `instance export` writes, or a game folder zip) becomes a new instance; a Java modpack goes to the Modpacks import; a resource or shader pack into the instance (default: the selected one).
|
||||
|
||||
horizon-launcher instance import <FILE>
|
||||
|
||||
- `FILE`
|
||||
- `--instance`: The instance a pack goes into
|
||||
|
||||
MCP: `instance_import`.
|
||||
|
||||
## `horizon-launcher worlds list`
|
||||
|
||||
The worlds: name, mode, version, last played and size (the default).
|
||||
|
||||
horizon-launcher worlds list
|
||||
|
||||
- `--instance`: The instance (default: the selected one)
|
||||
|
||||
MCP: `worlds_list`.
|
||||
|
||||
## `horizon-launcher worlds backup`
|
||||
|
||||
Zip a world into the instance's backups/ folder, as the game's Make Backup does.
|
||||
|
||||
horizon-launcher worlds backup <WORLD>
|
||||
|
||||
- `WORLD`: Its folder or name
|
||||
- `--instance`
|
||||
|
||||
MCP: `worlds_backup`.
|
||||
|
||||
## `horizon-launcher worlds copy`
|
||||
|
||||
Copy a world beside it, as "<name> (1)".
|
||||
|
||||
horizon-launcher worlds copy <WORLD>
|
||||
|
||||
- `WORLD`
|
||||
- `--instance`
|
||||
|
||||
MCP: `worlds_copy`.
|
||||
|
||||
## `horizon-launcher worlds delete`
|
||||
|
||||
Move a world to the system's trash.
|
||||
|
||||
horizon-launcher worlds delete <WORLD>
|
||||
|
||||
- `WORLD`
|
||||
- `--instance`
|
||||
|
||||
MCP: `worlds_delete`, needs `confirm: true`.
|
||||
|
||||
## `horizon-launcher worlds datapack-list`
|
||||
|
||||
A world's data packs, and which are on.
|
||||
|
||||
horizon-launcher worlds datapack-list <WORLD>
|
||||
|
||||
- `WORLD`
|
||||
- `--instance`
|
||||
|
||||
MCP: `worlds_datapack_list`.
|
||||
|
||||
## `horizon-launcher worlds datapack-add`
|
||||
|
||||
Copy a data pack zip into a world (the game turns it on when the world opens).
|
||||
|
||||
horizon-launcher worlds datapack-add <WORLD> <FILE>
|
||||
|
||||
- `WORLD`
|
||||
- `FILE`
|
||||
- `--instance`
|
||||
|
||||
MCP: `worlds_datapack_add`.
|
||||
|
||||
## `horizon-launcher worlds datapack-remove`
|
||||
|
||||
Move a world's data pack to the system's trash.
|
||||
|
||||
horizon-launcher worlds datapack-remove <WORLD> <PACK>
|
||||
|
||||
- `WORLD`
|
||||
- `PACK`: Its file name, with or without .zip
|
||||
- `--instance`
|
||||
|
||||
MCP: `worlds_datapack_remove`, needs `confirm: true`.
|
||||
|
||||
## `horizon-launcher packs list`
|
||||
|
||||
The resource and shader packs, and which are on (the default).
|
||||
|
||||
horizon-launcher packs list
|
||||
|
||||
- `--kind` (resource, shader): Only this kind
|
||||
- `--instance`: The instance (default: the selected one)
|
||||
|
||||
MCP: `packs_list`.
|
||||
|
||||
## `horizon-launcher packs add`
|
||||
|
||||
Copy a pack file in: a resource pack .zip, a shader pack .zip or a .hshader.
|
||||
|
||||
horizon-launcher packs add <FILE>
|
||||
|
||||
- `FILE`
|
||||
- `--instance`
|
||||
|
||||
MCP: `packs_add`.
|
||||
|
||||
## `horizon-launcher packs on`
|
||||
|
||||
Turn a pack on (a resource pack goes on top; a shader pack replaces the one that was on).
|
||||
|
||||
horizon-launcher packs on <PACK>
|
||||
|
||||
- `PACK`: Its file name or title
|
||||
- `--kind` (resource, shader)
|
||||
- `--instance`
|
||||
|
||||
MCP: `packs_on`.
|
||||
|
||||
## `horizon-launcher packs off`
|
||||
|
||||
Turn a pack off.
|
||||
|
||||
horizon-launcher packs off <PACK>
|
||||
|
||||
- `PACK`
|
||||
- `--kind` (resource, shader)
|
||||
- `--instance`
|
||||
|
||||
MCP: `packs_off`.
|
||||
|
||||
## `horizon-launcher packs remove`
|
||||
|
||||
Turn a pack off and move it to the system's trash.
|
||||
|
||||
horizon-launcher packs remove <PACK>
|
||||
|
||||
- `PACK`
|
||||
- `--kind` (resource, shader)
|
||||
- `--instance`
|
||||
|
||||
MCP: `packs_remove`, needs `confirm: true`.
|
||||
|
||||
## `horizon-launcher screenshots list`
|
||||
|
||||
The screenshots, the newest first, with their files (the default).
|
||||
|
||||
horizon-launcher screenshots list
|
||||
|
||||
- `--instance`: The instance (default: the selected one)
|
||||
|
||||
MCP: `screenshots_list`.
|
||||
|
||||
## `horizon-launcher screenshots delete`
|
||||
|
||||
Move a screenshot to the system's trash.
|
||||
|
||||
horizon-launcher screenshots delete <SCREENSHOT>
|
||||
|
||||
- `SCREENSHOT`: Its file name, with or without .png
|
||||
- `--instance`
|
||||
|
||||
MCP: `screenshots_delete`, needs `confirm: true`.
|
||||
|
||||
## `horizon-launcher multiplayer list`
|
||||
|
||||
The servers of the game's Multiplayer screen (the default).
|
||||
|
||||
horizon-launcher multiplayer list
|
||||
|
||||
- `--instance`: The instance (default: the selected one)
|
||||
|
||||
MCP: `multiplayer_list`.
|
||||
|
||||
## `horizon-launcher multiplayer add`
|
||||
|
||||
Add a server to the list.
|
||||
|
||||
horizon-launcher multiplayer add <ADDRESS>
|
||||
|
||||
- `ADDRESS`: Its address, as in the game's Add Server (host or host:port)
|
||||
- `--name`: Its name in the list (default: Minecraft Server)
|
||||
- `--instance`
|
||||
|
||||
MCP: `multiplayer_add`.
|
||||
|
||||
## `horizon-launcher multiplayer remove`
|
||||
|
||||
Remove a server from the list: its position from 1, name or address.
|
||||
|
||||
horizon-launcher multiplayer remove <SERVER>
|
||||
|
||||
- `SERVER`
|
||||
- `--instance`
|
||||
|
||||
MCP: `multiplayer_remove`, needs `confirm: true`.
|
||||
|
||||
## `horizon-launcher modpack list`
|
||||
|
||||
The imported packs and their coverage (the default).
|
||||
@@ -308,10 +616,12 @@ MCP: `modpack_remove`, needs `confirm: true`.
|
||||
|
||||
## `horizon-launcher mods list`
|
||||
|
||||
What the browser installed (the default).
|
||||
What the browser installed in an instance (the default).
|
||||
|
||||
horizon-launcher mods list
|
||||
|
||||
- `--instance`: The instance (default: the selected one)
|
||||
|
||||
MCP: `mods_list`.
|
||||
|
||||
## `horizon-launcher mods search`
|
||||
@@ -321,7 +631,7 @@ Search for packs Horizon loads.
|
||||
horizon-launcher mods search [TEXT]...
|
||||
|
||||
- `TEXT`
|
||||
- `--kind` (mod, resource, modpack, shader)
|
||||
- `--kind` (mod, resource, modpack, shader, datapack)
|
||||
- `--everything`: Also what was made for other versions or runs only partly, each marked
|
||||
- `--source` (modrinth, curseforge, horizon)
|
||||
|
||||
@@ -341,11 +651,13 @@ MCP: `mods_check`.
|
||||
|
||||
## `horizon-launcher mods install`
|
||||
|
||||
Install a pack and what it needs, by its id or slug (checksums checked); a Java mod is ported into horizon-mods and turned on; a modpack is imported.
|
||||
Install a pack and what it needs into an instance, by its id or slug (checksums checked); a Java mod is ported into horizon-mods and turned on; a modpack is imported as an instance of its own; a data pack goes into the world `--world` names.
|
||||
|
||||
horizon-launcher mods install <PROJECT>
|
||||
|
||||
- `PROJECT`
|
||||
- `--world`: Install the project's data pack into this world of the instance (its name or folder)
|
||||
- `--instance`: The instance (default: the selected one)
|
||||
- `--everything`: Allow a version made for another Minecraft version
|
||||
- `--source` (modrinth, curseforge, horizon)
|
||||
|
||||
@@ -359,6 +671,7 @@ Update what the browser installed (or one pack).
|
||||
|
||||
- `PROJECT`
|
||||
- `--check`: Only say what is newer
|
||||
- `--instance`: The instance (default: the selected one)
|
||||
|
||||
MCP: `mods_update`.
|
||||
|
||||
@@ -369,6 +682,7 @@ Remove a pack the browser installed.
|
||||
horizon-launcher mods remove <PROJECT>
|
||||
|
||||
- `PROJECT`
|
||||
- `--instance`: The instance (default: the selected one)
|
||||
|
||||
MCP: `mods_remove`, needs `confirm: true`.
|
||||
|
||||
@@ -379,6 +693,7 @@ Turn on a mod the browser installed (horizon-mods.txt, as the game's Options > M
|
||||
horizon-launcher mods enable <PROJECT>
|
||||
|
||||
- `PROJECT`
|
||||
- `--instance`: The instance (default: the selected one)
|
||||
|
||||
MCP: `mods_enable`.
|
||||
|
||||
@@ -389,6 +704,7 @@ Turn off a mod the browser installed; it stays installed.
|
||||
horizon-launcher mods disable <PROJECT>
|
||||
|
||||
- `PROJECT`
|
||||
- `--instance`: The instance (default: the selected one)
|
||||
|
||||
MCP: `mods_disable`.
|
||||
|
||||
|
||||
+10
-2
@@ -1,6 +1,6 @@
|
||||
# The launcher's mod browser
|
||||
|
||||
Search Modrinth (CurseForge support is coming soon) for Java mods, modpacks and resource packs, and Horizon's
|
||||
Search Modrinth (CurseForge support is coming soon) for Java mods, modpacks, resource packs and data packs, and Horizon's
|
||||
registry for Horizon's own mods, modpacks, resource packs and shader packs; see how well each one runs before installing it, and install it with its checksum checked. This is item 16 of the roadmap and issue #577. The code is in
|
||||
`launcher/src/browser.rs` and `launcher/src/browser/`.
|
||||
|
||||
@@ -17,6 +17,12 @@ yet (Modrinth has no `horizon` loader).
|
||||
| Resource packs | `resourcepacks/` beside `options.txt` | **Works** when made for 26.3 ([resource-packs.md](resource-packs.md) lists what Horizon reads). Older packs are **Partly**: they load with vanilla's compatibility warning |
|
||||
| Modpacks (`.mrpack`, CurseForge zip) | the Modpacks page's import | **Partly**: Horizon runs the mods it can port, from the player's own downloads ([modpacks.md](modpacks.md)) |
|
||||
| Shader packs (`.hshader`, Horizon's registry only) | `shaderpacks/` beside `options.txt` | **Works** when made for 26.3: checked by the game's own check before install ([shaders.md](shaders.md)). The `shaders/`-format packs on Modrinth and CurseForge are not offered |
|
||||
| Data packs (Modrinth) | `datapacks/` of the world picked on the **Data packs** tab (`mods install <pack> --world <world>`); not in the Installed list: each world's list on Home has them | **Partly**: Horizon runs a data pack's functions, function tags, predicates and item modifiers, not yet its recipes, loot tables, advancements, other tags or worldgen. The install reads the zip and says what of it runs; a pack with none of those (worldgen only, such as Tectonic) is refused |
|
||||
|
||||
Mods, resource packs and shader packs go into the game folder of the instance selected in the sidebar, and the
|
||||
Installed list, updates and Remove are that instance's: picking another instance reads its list. The page says which
|
||||
instance it installs into when there is more than one. The CLI's `mods list|install|update|remove|enable|disable` take
|
||||
`--instance <name>` (default: the selected one). A modpack becomes an instance of its own.
|
||||
|
||||
By default a search shows only what runs: Java mods made for 26.3, resource packs made for 26.3, and every modpack. **Show everything** lists the rest of the kind too, each marked with how well it runs; what doesn't run is
|
||||
never offered for install.
|
||||
@@ -82,7 +88,8 @@ downloads, source and licence, how well it runs (and why), **Page** (the project
|
||||
**Install** (**Import** for a modpack). The Modpacks tab lists the imported packs first, with their coverage
|
||||
report, **Port** and **Play** ([modpacks.md](modpacks.md)). Installed packs are listed above the results with their version, source,
|
||||
file and the checksum they were checked against, with **Update to …** when a newer version runs and **Remove**
|
||||
(asked twice).
|
||||
(asked twice). **Update all (N)** above the list updates every pack a newer version was found for, of every kind,
|
||||
one after the other; one that fails is named and doesn't stop the others.
|
||||
|
||||
### Project pages, filters and icons
|
||||
|
||||
@@ -130,6 +137,7 @@ same name the player put there is never overwritten.
|
||||
pack still has to be turned on in the game's Resource Packs screen, as in vanilla, and a shader pack picked in
|
||||
the game's Shader Packs page.
|
||||
- **Update** installs the newer version and removes the old file.
|
||||
- **Update all** does the same for each pack with a newer version (`horizon-launcher mods update` with no pack name).
|
||||
- **Remove** deletes the file and its entry. Packs installed as dependencies stay.
|
||||
- **A modpack** is downloaded (checked the same way) into `ports/downloads/`, imported, and ported straight away
|
||||
for the selected version when it is prepared (`modpacks::import_and_port`): the jars of the mods Horizon can carry
|
||||
|
||||
+53
-10
@@ -15,7 +15,7 @@ folder, loads no runtime and plays exactly like vanilla 26.3.
|
||||
| The contract (WIT) | `crates/horizon-mod-sdk/wit/horizon.wit` | 0.1: log, game-read, chat, hud, storage, command, ui; tick, frame, chat and command hooks |
|
||||
| SDK for mod authors | `crates/horizon-mod-sdk` | 0.1 |
|
||||
| Example mods | `crates/horizon-mod-sdk/examples/coords-hud`, `examples/predator-missile` | coordinates, facing and time HUD, `/where`, `/coords`; `/missile`, a guided missile from vanilla commands |
|
||||
| Horizon's official mods | `mods/official/` | the extras moving to the registry: FPS Counter (`fps-overlay`), Keystrokes, Zoom, Minimap |
|
||||
| Horizon's official mods | `mods/official/` | the extras moving to the registry: FPS Counter (`fps-overlay`), Keystrokes, Zoom, Minimap; and Recipes, a recipe viewer |
|
||||
| Runtime | `crates/horizon-mods` | wasmtime 48 LTS, component model |
|
||||
| Authoring tool | `crates/cargo-horizon-mod` | `cargo horizon-mod new [--template code\|content] / build / run / test / check`, and the registry's CI (`registry build / review / list`) |
|
||||
| In the game | `crates/horizon-client/src/game/mods.rs`, Options > Mods | client mods |
|
||||
@@ -88,9 +88,10 @@ folder, loads no runtime and plays exactly like vanilla 26.3.
|
||||
| `hud` | `hud` | `set-panel(corner, lines)`, `clear()`: up to 16 lines of 256 characters |
|
||||
| `storage` | `storage` | `get(key)`, `set(key, value)`, `delete(key)`: a per-mod folder of up to 64 files, 4 MiB total, at most 1 MiB written per call |
|
||||
| `command` | `command` | `run(line)`: a vanilla command run as the player, with the player's permissions, after the hook returns (8 per call); mods' own commands are not run. `run-quiet(lines)`: up to 256 a call, the same rights, nothing in the chat (single player and Horizon's servers run them 64 a tick and log one line a batch; elsewhere they go as chat commands and their feedback shows) |
|
||||
| `ui` | `ui` | `open-screen`, `close-screen`, `set-settings`: a screen the mod owns and a page in Options > Mods, of text, button, item and list widgets the game lays out and draws with its own menus' code. **Experimental:** the manifest needs `experimental = ["ui"]` |
|
||||
| `ui` | `ui` | `open-screen`, `close-screen`, `set-settings`: a screen the mod owns and a page in Options > Mods, of text, button, item and list widgets the game lays out and draws with its own menus' code; `browser.set-items`, `browser.poll`: a recipe viewer's panel of items right of the inventory and container screens (not the creative one), which the game pages and draws with its own slots and search box, and the mod hears its clicks, its searches and the mod's own keys (`input.register-key`) pressed over any item on the screen; `browser.set-recipes`: recipes in the panel's place (crafting grids, cooking, stonecutting, smithing and brewing layouts, their slots cycling through their stacks, a note and an action button each), paged by the game, with clicks on their slots, action buttons, page turns and a back button. **Experimental:** the manifest needs `experimental = ["ui"]` |
|
||||
| `render` | `render` | `set-hud(shapes)`: up to 1024 fills, four-cornered shapes, GUI sprites, items and text, kept on the HUD (over the hotbar, under chat and screens, hidden with F1) until replaced; `set-corner(corner, w, h, shapes)`: a box the game places in a corner, stacked with its overlays and other panels, as `hud`'s panels are; `text-width(text)`; `frame-stats()`: the game's FPS, min and 1% low; `gui-size()`; `shake(strength, seconds)`: the view turns, the player doesn't, scaled by Distortion Effects; `set-zoom(zoom)`: the field of view divided by up to 10, eased or at once, with slower turning, while playing and not through a spyglass (the strongest of several mods' zooms counts); `set-minimap(minimap)`: a map of the world around the player in a corner, as a map item colours it (the floor underground and under roofs), square or round, turning with the player or north up, with the player's arrow; the game keeps its tiles within its own frame budget (one map at a time, the first loaded mod's). The game's own HUD renderer draws them: a mod never supplies shader code. **Experimental:** `experimental = ["render"]` |
|
||||
| `input` | `input` | `claim-items(ids)`: the use button on those items is the mod's (`use-start`, `use-stop` with the ticks held; the game doesn't place, eat or swing); `register-key(name, label, key)`: up to 16 keys (`key.keyboard.r`), heard while playing as `key-down` / `key-up` (the game's own mapping on that key still runs; a screen opening lets held keys up), mouse buttons as `key.mouse.4`. The player rebinds them on the mod's page in Options > Mods, where the game lists them first as Key Binds rows (click, then press a key or mouse button; Esc binds none), even for a mod without `ui`; the choice is kept in `horizon-mods.txt` (`key.<mod>.<name>:key.keyboard.z`) and wins over `register-key`'s default; `claim-wheel(on)`: the wheel's steps become `wheel` events and the hotbar doesn't move (the one input a mod takes from the game; a mod's keys never do); `held()`; `mapping(name)`: a movement or click mapping's key label and whether it is held; `clicks-per-second()`; `poll()` returns the events, at most 256 kept. **Experimental:** `experimental = ["input"]` |
|
||||
| `recipes` | `recipes` | `items()`: every item in the registry's order, with its name in the player's language and its tags; `all()`: every recipe (crafting, smelting, blasting, smoking, campfire, stonecutting, smithing, brewing), its slots as the stacks that fit each, its results, cooking time and experience, and the recipe book's id for it; `known()`: the book ids the player's recipe book holds; `place(book-id, all)`: the recipe book's click on a recipe, in the open inventory's or crafting table's grid (refused for a recipe the player's book doesn't hold, as vanilla's server refuses it); `give(stack)`: in creative mode, the stack into the player's inventory, as from the creative inventory. The recipes are the world's in single player and on Horizon's servers, vanilla 26.3's on any other server (a client is sent no others), while `known` follows that server's book. The game makes the tables once, when a mod first reads them. **Experimental:** `experimental = ["recipes"]` |
|
||||
|
||||
| Hook (export) | When |
|
||||
|---|---|
|
||||
@@ -116,7 +117,6 @@ loading. Ordered by what the first native ports need:
|
||||
| `keys` | keybinds | registered binds appear in Controls; press/release events |
|
||||
| `target` | the crosshair's block or entity, with its state and NBT summary | Jade/WTHIT-style tooltips |
|
||||
| `inventory-read` | the player's inventory, held item, open container | AppleSkin, recipe viewers |
|
||||
| `recipes` | the recipe registry and lookups | JEI/EMI-style viewers |
|
||||
| `world-read` | blocks and biomes around the player, within the render distance | minimaps, schematics |
|
||||
| `render` (world) | world-space lines, boxes and billboards, beside the HUD shapes `render` has | Litematica-style placement, waypoints |
|
||||
| `registries` | new blocks, items, entities and recipes, mostly data: JSON models, textures, loot and recipes in the `.hmod`'s `assets/` and `data/` | server side; see [Multiplayer](#multiplayer) |
|
||||
@@ -285,6 +285,7 @@ A step's parts happen in this order:
|
||||
| --- | --- |
|
||||
| `reload = true` | stops the mod and starts it again, as a rebuild does in the game: its memory starts over, its `storage` stays |
|
||||
| `title-screen = true` | no player and no clock until a step sets them |
|
||||
| `blocks = [{ x = 0, y = 63, z = 0, state = "minecraft:stone" }]` | server mods with `world`: those blocks of the Overworld, before the rest of the step (every other block is air, every biome the dimension's plainest: plains, nether wastes, the end) |
|
||||
| `player = { x = 3.0, ... }`, `clock = { day-time = 0 }` | changes those fields (`x y z yaw pitch health food dimension`, `game-time day-time`) |
|
||||
| `ticks = n`, `frames = n` | that many ticks (the game's tick counter and the clock move on), then frames 1/60 s apart |
|
||||
| `chat = "<Steve> hi"` | a chat line the player receives |
|
||||
@@ -310,6 +311,7 @@ checked:
|
||||
| `feedback = "..."`, `error = "..."` | the command's answer, shown plain or in red |
|
||||
| `panel = ["..."]`, `corner = "top-left"` | its HUD panel's lines (`[]`: no panel) and corner |
|
||||
| `told = ["Alex: Welcome!"]`, `broadcast = ["..."]` | server mods: every `players.tell` (as `name: text`) and `players.broadcast`, in order |
|
||||
| `blocks = [{ x = 2, y = 64, z = 0, state = "minecraft:glowstone" }]` | server mods with `world`: those blocks of the Overworld after the step, the mod's `set-blocks` made (the script checks a state's shape; the game checks its name) |
|
||||
| `stopped = "panic"` | the mod was turned off, for a reason holding this text; without it, a mod that traps, panics or overruns fails the test |
|
||||
|
||||
Unknown keys are errors, so a typo never passes silently. The same runner is
|
||||
@@ -478,6 +480,7 @@ its component targets the WIT world `horizon-server-mod` instead of
|
||||
| `log` | always | as for client mods |
|
||||
| `storage` | `storage` | as for client mods, in the server's `horizon-mods/` |
|
||||
| `players` | `players` | `online()`: id, name, position, dimension, game mode, health of each player on; `tell(id, text)`, `broadcast(text)`: system messages after the mod's name, 8 per call |
|
||||
| `world` | `world` | `get-block(dimension, x, y, z)`: the state in a loaded chunk, `minecraft:oak_log[axis=y]`; `get-biome(dimension, x, y, z)`: `minecraft:plains`, ...; `set-blocks(dimension, changes)`: up to 4096 per call, checked at once, made as `/setblock` makes them (neighbours, light, block entities, every player told) after the call, before that dimension's next tick |
|
||||
|
||||
| Hook (export `server-events`) | When |
|
||||
|---|---|
|
||||
@@ -485,13 +488,51 @@ its component targets the WIT world `horizon-server-mod` instead of
|
||||
| `tick(tick)` | each server tick |
|
||||
| `player-joined(player)`, `player-left(player)` | `registration.joins` |
|
||||
| `chat(player, text)` | `registration.chat`: each chat message a player sends |
|
||||
| `command(player, name, args)` | `/name args` typed by a player, for a command it registered; `ok(some)` is that player's feedback, `err` their red error |
|
||||
| `command(player, name, args, values)` | `/name args` typed by a player, for a command it registered, with its arguments' values (below); `ok(some)` is that player's feedback, `err` their red error |
|
||||
| `block-broken(player, pos, state)`, `block-placed(player, pos, state)` | `registration.blocks`, with the state as `minecraft:oak_log[axis=y]` |
|
||||
|
||||
Capabilities that act on a local player (`game-read`, `chat`, `hud`) are for
|
||||
client mods; `players` is for server mods. In Rust: `impl
|
||||
horizon_mod_sdk::server::ServerMod` and `export_server_mod!`; the example is
|
||||
[`welcome`](../crates/horizon-mod-sdk/examples/welcome/src/lib.rs).
|
||||
[`welcome`](../crates/horizon-mod-sdk/examples/welcome/src/lib.rs), and with
|
||||
`world`, [`beacons`](../crates/horizon-mod-sdk/examples/beacons/src/lib.rs).
|
||||
|
||||
**Typed commands.** Each command in `registration.commands` lists its
|
||||
arguments, in order: a name and a kind, required or optional (optional ones
|
||||
last). The server adds them to the command tree every player receives, after
|
||||
vanilla's commands, so a player's chat box completes and colours them as it
|
||||
does vanilla's (player names, coordinates, bounds); when a player sends one,
|
||||
the server parses the line the way vanilla's parsers do and gives the mod the
|
||||
values, by argument name, or answers with vanilla's error (`Integer must not
|
||||
be more than 64, found 65`, `No player was found`) without calling the mod.
|
||||
|
||||
| Kind | Takes | Value | Chat box parser |
|
||||
|---|---|---|---|
|
||||
| `word` | one word: letters, digits, `_ - . +` | `word(string)` | `brigadier:string` (word) |
|
||||
| `text` | the rest of the line, only last | `text(string)` | `brigadier:string` (greedy) |
|
||||
| `integer(min, max)` | a whole number within the bounds given | `integer(s32)` | `brigadier:integer` |
|
||||
| `number` | a number | `number(f64)` | `brigadier:double` |
|
||||
| `boolean` | `true` or `false` | `boolean(bool)` | `brigadier:bool` |
|
||||
| `player` | an online player's name, `@s` or `@p` (whoever typed it) | `player(player)` | `minecraft:entity` (one player) |
|
||||
| `block-pos` | `x y z`, each a whole number, `~` or `~n` (from whoever typed it) | `block-pos(block-pos)` | `minecraft:block_pos` |
|
||||
|
||||
A command with no arguments takes nothing after its name. In Rust,
|
||||
`Registration::command_with("beacon", [Argument::integer("height", Some(1),
|
||||
Some(64)).optional()])`, read with `args.integer("height")`; `command(name)`
|
||||
alone takes free text, an optional `text` argument named `args`
|
||||
(`args.text()` is the line as typed either way).
|
||||
|
||||
**Capability `world`.** Reads are of the server's loaded chunks as they are
|
||||
during the call: the game lends a server mod's call the levels' chunk maps
|
||||
(moved, not copied, and only while a running mod has `world`), so a read
|
||||
costs a map lookup and no copy of the world. A dimension with no chunk loaded
|
||||
at a position reads as none. Writes go through the same code as `/setblock`,
|
||||
so block updates, light, block entities and every client (LAN guests,
|
||||
dedicated server players) see them as vanilla's; the parity harnesses test
|
||||
that code. Changes for a dimension whose level isn't ticking wait for it
|
||||
(in-frame single player ticks only the player's), up to 65,536 blocks; a
|
||||
change in a chunk that isn't loaded when it is made is skipped, as `/setblock`
|
||||
refuses one.
|
||||
|
||||
**Where they run.** The game that simulates the world starts the server mods
|
||||
that are on, and only that one:
|
||||
@@ -521,10 +562,11 @@ chat for the in-frame player and a system message for a connection;
|
||||
on, each of these points costs one branch (measured in the PR that added
|
||||
them).
|
||||
|
||||
**Not yet.** Clients aren't sent server mods' commands with vanilla's
|
||||
command tree, so a player's chat box doesn't complete or colour them; typing
|
||||
them works. Block events are a player's own breaking and placing, not
|
||||
explosions, pistons or other mods.
|
||||
**Not yet.** Block events are a player's own breaking and placing, not
|
||||
explosions, pistons or other mods. Command arguments don't take entities,
|
||||
items or block states yet, and `^` coordinates; in-frame single player's chat
|
||||
box lists server mods' commands by name only (the server still parses their
|
||||
arguments).
|
||||
|
||||
## Publish your mod
|
||||
|
||||
@@ -555,7 +597,7 @@ says how). The formats: [api/mod-index.md](api/mod-index.md).
|
||||
|
||||
### Horizon's official mods
|
||||
|
||||
The Horizon extras that are mods now live in `mods/official/<name>/`, one crate each in the game's workspace, so
|
||||
The Horizon extras that are mods now, and Horizon's own recipe viewer, live in `mods/official/<name>/`, one crate each in the game's workspace, so
|
||||
`cargo clippy --workspace` and pr_ready cover them. They use only the public API, like any other mod, with the same
|
||||
options on their settings page as the extra had and the same look. Each is published by a maintainer: build it on
|
||||
`main` with the toolchain CI uses (`cd mods/official/<name> && cargo horizon-mod build`), then open a pull request in
|
||||
@@ -569,6 +611,7 @@ so the same rustc and `Cargo.lock` give the same file.
|
||||
| Keystrokes | `keystrokes` | Extras > Keystrokes | `corner`: as above, default `top_left`; `cps`: `true` (default), `false` |
|
||||
| Zoom | `zoom` | Extras > Zoom | `level`: `2`, `3`, `4` (default), `6`, `8`, `10`; `smooth`: `true` (default), `false`; `sensitivity` (slower turning): `true` (default), `false`. The key is the game's: `key.zoom.zoom` in `horizon-mods.txt`, default `key.keyboard.z` |
|
||||
| Minimap | `minimap` | Extras > Minimap | `corner`: as above, default `top_right`; `size`: `64`, `96` (default), `128`; `shape`: `square` (default), `round`; `zoom` (blocks per pixel): `0.5`, `1` (default), `2`, `4`; `rotate`: `false` (default), `true`. The game draws the map (`render.set-minimap`) |
|
||||
| Recipes | `recipes` | nothing (new) | `give` (a click on the item panel gives the item in creative mode: one, a stack with a right click): `false` (default), `true`. The keys are the game's: `key.recipes.recipe` (default `key.keyboard.r`) and `key.recipes.uses` (default `key.keyboard.u`) in `horizon-mods.txt`. Every item sits in the item panel (`browser`) with a search box (words in the name or id, `@namespace`, `#tag`); R or a click shows an item's recipes, U or a right click its uses, a tab per station, and + fills the grid with a recipe the player knows (`recipes.place`). On servers that are not Horizon it shows the game's own 26.3 recipes; known recipes and + follow the server's recipe book |
|
||||
|
||||
## Versions and compatibility
|
||||
|
||||
|
||||
+22
-4
@@ -13,7 +13,7 @@ python3 tools/parity.py --failed # the ones that failed last time
|
||||
python3 tools/parity.py --all # everything, from scratch: the audit (26 minutes on the Mac mini alone)
|
||||
python3 tools/parity.py --fresh food # don't reuse vanilla oracle results
|
||||
python3 tools/parity.py --repeat 3 food # run it three times; the runs must agree
|
||||
python3 tools/parity.py --hosts macmini,thinkpad # with other machines (default: tools/parity_hosts.json's default list, empty)
|
||||
python3 tools/parity.py --hosts macmini,playhorizon # with other machines (default: tools/parity_hosts.json's default list, empty)
|
||||
python3 tools/parity.py --list # what would run
|
||||
python3 tools/parity.py --status # last result of each harness
|
||||
python3 tools/parity.py --changed origin/main # those a branch's changes can affect (CI's parity job)
|
||||
@@ -40,9 +40,20 @@ The game logs into `HORIZON_HOME` and falls back to the player's own game folder
|
||||
|
||||
### Other machines
|
||||
|
||||
Harnesses can also run on the Mac mini, the ThinkPad and the desktop (`tools/parity_hosts.json` describes them; `desktop` uses its CI runner's environment and vanilla data, and refuses work, or stops it, while someone uses it: docs/release-flow.md, "The desktop's runner"; its `default` list is empty, so pass `--hosts macmini,thinkpad` or set `PARITY_HOSTS`, after copying `shared-local/` to `~/code/horizon-parity/shared-local` on each host). The runner mirrors the worktree there with rsync (not `.git`, `.local`, `target` or ignored files) into `~/code/horizon-parity/remote/<host><path>`, whose `.local` links to the vanilla data in `~/code/horizon-parity/shared-local`, and starts `tools/parity.py --worker` over ssh. The worker builds the probes (about 80 s the first time) and runs what it is sent under the same tracer, admitting harnesses against its own free memory. One queue, longest first, feeds every machine, remote ones first: the Mac takes up to 14 harnesses, the desktop 8. Each pass comes back with the content hash of every file it depended on, so it is keyed on exactly what ran, and logs come back to `.local/parity-runner/logs/`; state, sharing and `gate.py` work as before. If a host can't be reached, or drops out, its harnesses run here.
|
||||
Harnesses can also run on the Mac mini, the desktop and playhorizon (`tools/parity_hosts.json` describes them; `desktop` and `playhorizon` use their CI runner's environment and vanilla data, and the desktop refuses work, or stops it, while someone uses it: docs/release-flow.md, "The desktop's runner"; its `default` list is empty, so pass `--hosts macmini,playhorizon` or set `PARITY_HOSTS`, after copying `shared-local/` to `~/code/horizon-parity/shared-local` on each host). The runner mirrors the worktree there with rsync (not `.git`, `.local`, `target` or ignored files) into `~/code/horizon-parity/remote/<host><path>`, whose `.local` links to the vanilla data in `~/code/horizon-parity/shared-local`, and starts `tools/parity.py --worker` over ssh. The worker builds the probes (about 80 s the first time) and runs what it is sent under the same tracer, admitting harnesses against its own free memory. One queue, longest first, feeds every machine, remote ones first: the Mac takes up to 14 harnesses, the desktop 8, playhorizon 3 (on CPUs 0-3: its CI runner has 4-7). Each pass comes back with the content hash of every file it depended on, so it is keyed on exactly what ran, and logs come back to `.local/parity-runner/logs/`; state, sharing and `gate.py` work as before. If a host can't be reached, or drops out, its harnesses run here.
|
||||
|
||||
Harnesses a host can't run are listed in the file: `local_only` (`save_roundtrip` runs the game on a virtual screen) and each host's `exclude`. The Mac excludes nothing: vanilla's `Math.sin`, `pow`, `log` and the like don't round the same on an Apple silicon Mac as on Linux (HotSpot uses fdlibm there, Intel's stubs on x86-64), and Rust's float functions round like neither (they call the platform libm), so code that mirrors a vanilla `Math` call uses `horizon_core::jmath`, which computes what HotSpot computes on the host architecture. The ThinkPad helps too, gently: Linux, 2 harnesses at `nice 19`, since it hosts the Claude account pool; it finds ALSA through `~/code/horizon-parity/alsa-dev` like the desktop.
|
||||
Harnesses a host can't run are listed in the file: `local_only` (`save_roundtrip` runs the game on a virtual screen) and each host's `exclude`. The Mac excludes nothing: vanilla's `Math.sin`, `pow`, `log` and the like don't round the same on an Apple silicon Mac as on Linux (HotSpot uses fdlibm there, Intel's stubs on x86-64), and Rust's float functions round like neither (they call the platform libm), so code that mirrors a vanilla `Math` call uses `horizon_core::jmath`, which computes what HotSpot computes on the host architecture. The ThinkPad no longer runs harnesses (2026-10-26): playhorizon is the Linux host that is always on.
|
||||
|
||||
### Any command on playhorizon: `tools/remote.sh`
|
||||
|
||||
For Linux work that doesn't need a whole parity run (a crate's tests, a few harnesses, a server build), `tools/remote.sh <worktree> <command...>` runs the command on playhorizon at the worktree's commit and streams its output back; its exit status is the command's. Commit and push first: the host fetches the commit from GitHub, and nothing else leaves this machine (no files, no credentials, no environment). Each worktree keeps one checkout there, `~/remote-work/<name>` with its own `target/`, so the next run only rebuilds what changed, and one run per name goes at a time. The command runs niced in the host's CI slice, pinned to CPUs 0-3 (`--cpus`): the CI runner has 4-7, so these runs never slow a pull request's parity job. A benchmark asks for its CPUs with `--cpus 0-3 --exclusive` (and says so in its pull request): it starts only when no other run uses them, and later runs wait for it to end. The command gets scratch game and launcher homes and the vanilla data linked as CI links it; a command naming `parity`, `lan_e2e` or `horizon-prepare` also gets `.local/horizon-client`, prepared as CI prepares it. Whatever the command leaves running (a game, a daemon) is stopped when it ends, and stopping `remote.sh` (or losing the connection) stops the command on the host. Logs stay in `~/remote-work/<name>.logs/`; `--list` shows the checkouts, `--gc [DAYS]` removes old ones.
|
||||
|
||||
```sh
|
||||
tools/remote.sh .claude/worktrees/my-fix cargo test -p horizon-world --lib # 33 s, warm
|
||||
tools/remote.sh . python3 tools/parity.py food # 19 s warm (4 min the first time); here: 188 s, 229 CPU-seconds
|
||||
```
|
||||
|
||||
The host is lent by a partner who keeps hypervisor access: send it no secret, token or credential, and never take a result from it as a CI result.
|
||||
|
||||
### Shards and Rust scopes
|
||||
|
||||
@@ -53,7 +64,7 @@ A harness can declare, at the top level of its script:
|
||||
|
||||
### Which harnesses a change affects
|
||||
|
||||
`--changed` and `--changed-files` narrow each harness's Rust sources to those its probes can reach (`tools/parity_reach.py`), so a change to one module of `horizon-client` no longer reruns every harness whose probe links the crate. The narrowing works on items, not files: from the probe modules a harness ran (or the binary it built), a free item (fn, type, const, static) is reached when a reached item names it in its own module, through a path or an import of a module that is named, or through a glob import; an inherent impl's methods count one by one once their type is reached and their name is mentioned; a trait impl counts once its trait and its type are reached (std's traits and types always are); a macro counts once invoked. Names match by spelling, so the result only over-approximates. A reached file's parent modules count through their `mod` declarations of it, compared with the merge base; Rust files a change adds take part, a dependency that was deleted counts as changed, code under `#[cfg(test)]` never counts, and a harness whose probe can't be found keeps every source. Parses are cached by content in `reach-cache.json` of the shared parity folder (beside `passes/`), so a new worktree starts warm; a harness's search stops as soon as it reaches a changed file, and after `PARITY_REACH_BUDGET` seconds (default 180) the remaining harnesses count every source their probes link, so choosing never holds a slow machine for long. `--by-crate` turns the narrowing off. On the last 20 pull requests merged on 2026-10-25, the harnesses picked went from 2255 to 1061 (2384 to 1592 harness-minutes; game-binary harnesses, which link all of `game/`, set the floor), and every harness a CI parity run failed in the week before was still picked; every source file a sample of probes executed (LLVM `-C instrument-coverage`) is among those kept. Building the graph takes 15 s cold, under a second warm, and up to a minute and a half on a change that reaches many harnesses.
|
||||
`--changed` and `--changed-files` narrow each harness's Rust sources to those its probes can reach (`tools/parity_reach.py`), so a change to one module of `horizon-client` no longer reruns every harness whose probe links the crate. The narrowing works on items, not files: from the probe modules a harness ran (or the binary it built), a free item (fn, type, const, static) is reached when a reached item names it in its own module, through a path or an import of a module that is named, or through a glob import; an inherent impl's methods count one by one once their type is reached and their name is mentioned; a trait impl counts once its trait and its type are reached (std's traits and types always are); a macro counts once invoked. Names match by spelling, so the result only over-approximates. A reached file's parent modules count through their `mod` declarations of it, compared with the merge base; Rust files a change adds take part, a dependency that was deleted counts as changed, code under `#[cfg(test)]` never counts, and a harness whose probe can't be found keeps every source. Parses are cached by content in `reach-cache.json` of the shared parity folder (beside `passes/`), so a new worktree starts warm; a harness's search stops as soon as it reaches a changed file, and after `PARITY_REACH_BUDGET` seconds (default 180) the remaining harnesses count every source their probes link, so choosing never holds a slow machine for long. `--by-crate` turns the narrowing off. With `--changed`, `Cargo.lock` and `Cargo.toml` changes that only add, remove or move workspace crates (a crate split: no registry or git package, version, feature, dependency or build setting changed across them, compared with the merge base) don't count: the moved code counts through its sources. A workspace crate's feature that such a change defines or turns on is allowed only where every source naming it changed too (the new crate's own files). #2160's split went from 352 harnesses to 123 this way (its own changes to the runner still select them all). On the last 20 pull requests merged on 2026-10-25, the harnesses picked went from 2255 to 1061 (2384 to 1592 harness-minutes; game-binary harnesses, which link all of `game/`, set the floor), and every harness a CI parity run failed in the week before was still picked; every source file a sample of probes executed (LLVM `-C instrument-coverage`) is among those kept. Building the graph takes 15 s cold, under a second warm, and up to a minute and a half on a change that reaches many harnesses.
|
||||
|
||||
## The gate
|
||||
|
||||
@@ -133,6 +144,13 @@ when named and in the nightly audit (`--all`). LAN writes `results.json`
|
||||
with the host mode and each result beside its screenshots and logs. A skipped
|
||||
case is recorded explicitly and does not count as passing coverage.
|
||||
|
||||
`known_flaky` in `tools/parity_hosts.json` lists harnesses that fail now and then for a
|
||||
cause not fixed yet, each with its reason. One that fails runs once more from
|
||||
scratch, and a pass then counts. `parity.py` prints a `RETRIED` line for it
|
||||
in its summary and in the CI job's summary (PR parity and parity-main), so the
|
||||
flake stays visible. No other harness gets this retry. Fix the cause, then take
|
||||
the harness off the list.
|
||||
|
||||
The game-binary fixture audit keeps these complementary direct rule tests:
|
||||
|
||||
- `command_harness.rs`: command feedback, styled spans and result callbacks,
|
||||
|
||||
+29
-11
@@ -13,7 +13,7 @@ reopened; labels never start it):
|
||||
| Job | Runs on | What | Time |
|
||||
| --- | --- | --- | --- |
|
||||
| `verify` | GitHub `ubuntu-latest` | Public-tree check, Python tests, rustfmt, clippy with warnings denied, Rust tests. Dependencies and the workspace build come from a cache saved by main's runs | ~4 min cold, less warm |
|
||||
| `parity / parity` | A runner with the label `horizon-game`: the Mac mini's two, and the desktop's while nobody uses it (below) | Only for a change to a harness, an oracle, a probe or the runner (or the `run-parity` label): the vanilla harnesses the change can affect (`tools/parity.py --changed <base>`). Other pull requests skip it: [parity-main](#parity-on-main) checks them on main | seconds when nothing is affected; minutes per affected harness |
|
||||
| `parity / parity` | A runner with the label `horizon-game`: the Mac mini's and playhorizon's (below) | Only for a change to a harness, an oracle, a probe or the runner (or the `run-parity` label): the vanilla harnesses the change can affect (`tools/parity.py --changed <base>`). Other pull requests skip it: [parity-main](#parity-on-main) checks them on main | seconds when nothing is affected; minutes per affected harness |
|
||||
|
||||
Pushes to main run `verify` only; the nightly audit covers main's harnesses.
|
||||
|
||||
@@ -27,11 +27,23 @@ quick steps and finishes in seconds.
|
||||
The job is `.github/workflows/parity.yml`, a reusable workflow: `checks` calls it for pull requests from this
|
||||
repository, `run-parity.yml` for a fork's pull request a maintainer labels `run-parity`.
|
||||
|
||||
A pull request every harness reaches (a crate split moves files every probe links: #2160 ran all 352 harnesses, 71
|
||||
minutes on a Mac mini runner, while five other pull requests' jobs queued behind it) carries the `full-parity` label:
|
||||
its job runs on playhorizon's runner only (4 harnesses at a time), and waits for it while that runner is busy
|
||||
instead of taking the Mac mini's. Labels don't start `checks`: add it when opening the pull request
|
||||
(`gh pr create --label full-parity`), or before the next push.
|
||||
|
||||
Horizon never downloads the game, so harnesses that compare with vanilla run only where the maintainer's own
|
||||
copy is: the Mac mini, his Linux desktop and playhorizon (below). Their runners run as the maintainer's account and keep their checkout
|
||||
copy is: the Mac mini and playhorizon (below). Their runners run as the maintainer's account and keep their checkout
|
||||
between runs (`clean: false`), so the probes build incrementally into `.local/parity-target` and earlier passes
|
||||
stand.
|
||||
|
||||
The job tests the pull request's head merged into main's current tip, which is what merging it would land: harness
|
||||
and game fixes that reached main after the branch was made apply to it too, and an old branch runs main's runner
|
||||
scripts and selection unless it changes them. The base for the selection is that main commit, so only the pull
|
||||
request's own changes count. The job summary names the main commit. A head that conflicts with main is tested
|
||||
alone, with a warning. The check is still reported on the head.
|
||||
|
||||
1. `tools/ci/runner-env.sh` puts the machine's Python 3.13 and the JDK `research-lock.json` pins on the PATH
|
||||
(Homebrew and `java_home` on the Mac; on Linux what `linux-runner.sh` pinned, else nixpkgs), and sccache when
|
||||
the machine has it.
|
||||
@@ -50,9 +62,6 @@ stand.
|
||||
modules, Java oracles and every Rust source their probes compile) changed since the merge base, plus any
|
||||
harness nothing is recorded about yet, and runs those that have no pass for their current inputs. A change to
|
||||
`Cargo.lock` or `research-lock.json` affects every harness. Each harness has 25 minutes, the job 45.
|
||||
The selection runs with main's `tools/parity.py` and `tools/parity_reach.py` (`--changed <base> --list`), so a
|
||||
branch made before a better selection landed gets it too, and the head's own `parity.py` then runs the named
|
||||
harnesses. A branch that changes either file selects with its own code.
|
||||
|
||||
Failed harnesses' logs are uploaded as the `parity-logs` artifact.
|
||||
|
||||
@@ -74,8 +83,9 @@ release's macOS build back. Each keeps its own checkout, `target/` and Rust inst
|
||||
`_work/horizon/shared-local` links to the first's, so they share the vanilla data, the preparations (one at a
|
||||
time, under a lock) and the parity passes and slots.
|
||||
|
||||
**The desktop's runner.** `ludodesktop-horizon` (labels `self-hosted`, `Linux`, `X64`, `ludodesktop`, and
|
||||
`horizon-game` once a full trial has passed there) runs on the maintainer's Linux desktop while nobody uses it: its
|
||||
**The desktop's runner (retired).** On 2026-10-26 the maintainer asked that CI stop using his desktop: its services are
|
||||
stopped and `ludodesktop-horizon` has no label a job asks for (only `self-hosted`, `Linux`, `X64`), so nothing waits for
|
||||
it. What follows describes it as it ran. It ran on the maintainer's Linux desktop while nobody used it: its
|
||||
screen locked, or untouched for 15 minutes (his rule, 2026-10-26). `tools/ci/linux-runner.sh install`, run there as
|
||||
him, registers it and installs two systemd user services: `horizon-runner` (the runner, in
|
||||
`~/.actions-runners/horizon`, nice 19, in `horizon-ci.slice` with CPU and I/O weight 20, half the threads (on all of
|
||||
@@ -96,12 +106,16 @@ and its failures bisect and comment on merges.
|
||||
|
||||
**playhorizon's runner.** `playhorizon-horizon` runs on a server a hosting partner lends the project (Ubuntu, 8
|
||||
AMD EPYC threads, 30 GB, in Detroit; reachable only through the maintainer's tailnet). Nobody sits at it, so the
|
||||
watcher never pauses it except by hand, and it gets the machine: `RUNNER_CPUS=7 RUNNER_MEMORY=24 RUNNER_JOBS=6`.
|
||||
watcher never pauses it except by hand. It gets half the machine: `RUNNER_MEMORY=24`, `CARGO_BUILD_JOBS` and the
|
||||
harness slots at 4, and a drop-in (`~/.config/systemd/user/horizon-runner.service.d/cpus.conf`) that starts it under
|
||||
`taskset -c 4-7` (the user slice can't set `AllowedCPUs`: systemd doesn't delegate the cpuset controller to it).
|
||||
Agents' `tools/remote.sh` runs and benchmarks share CPUs 0-3, so they never slow a pull request's job.
|
||||
Without Nix, `linux-runner.sh` takes the build libraries, the JDK, sccache, Xvfb and Mesa's software Vulkan
|
||||
(lavapipe; there is no GPU) from apt, and Python 3.13 from uv. The partner can reach the machine, so gh is not
|
||||
logged in there: the registration token comes from another machine (`RUNNER_TOKEN`), and no job with secrets may
|
||||
run there (parity has none). It is also a parity host (`playhorizon` in `tools/parity_hosts.json`, 6 jobs). Like
|
||||
the desktop's, it gets the `horizon-game` label only once a full trial has passed there.
|
||||
run there (parity has none). It is also a parity host (`playhorizon` in `tools/parity_hosts.json`, 3 jobs on CPUs 0-3). Since
|
||||
2026-10-26 it has the `horizon-game` label: pull requests' parity jobs run there or on the Mac mini, and `full-parity`
|
||||
ones only there.
|
||||
|
||||
## Merging
|
||||
|
||||
@@ -209,6 +223,7 @@ How releases are numbered, and how installs from before 0.2 reach it: [versionin
|
||||
| `release-now` | Releases as soon as main's checks pass, without waiting for merges to settle |
|
||||
| `skip-release` | Doesn't trigger a release and isn't listed in the notes |
|
||||
| `run-parity` | Runs the parity job once on a fork's pull request |
|
||||
| `full-parity` | Runs the pull request's parity job on playhorizon's runner only (a change every harness reaches) |
|
||||
| `parity-regression` | Opened by the nightly audit for a harness that fails on main |
|
||||
| `release-blocker` | On an issue: no game release is published while it is open ([One channel](#one-channel)) |
|
||||
|
||||
@@ -417,6 +432,9 @@ Releases ship often, so nothing they leave behind may grow without bound.
|
||||
(`~/.actions-runners/runner-gc.sh`, plist `dev.horizon.runner-gc`), never from a pull request's checkout. It skips a
|
||||
runner in a job, removes a checkout's cargo build folders past 12 GB (`MAX_TARGET_GB`) and harness work folders
|
||||
under `.local/` untouched for 3 days (`STALE_DAYS`), and keeps the 2 newest shared preparations (`KEEP_PREPARED`)
|
||||
while no runner works. Runner builds go through the machine's sccache (`tools/ci/runner-env.sh`), so what it removes
|
||||
while no runner works. It also stops harness JVMs (vanilla servers, oracles) left orphaned for 3 hours
|
||||
(`ORPHAN_HOURS`): parent gone, command line under a runner's checkout or a worktree's `.local/`. `tools/parity.py`
|
||||
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'`.
|
||||
|
||||
@@ -43,7 +43,7 @@ to players. Players still prepare their own copy from their official launcher (`
|
||||
| `crates/horizon-client/src/lan/tracking.rs` | `generate_entity_tracking.py` | decompiled `EntityTypes` |
|
||||
| `crates/horizon-client/src/lan/command_suggestions.rs` | `generate_command_suggestions.py` | `VanillaCommandSuggestionsExporter` |
|
||||
| `crates/horizon-client/src/lan/command_order.rs` | `generate_lan_command_order.py` | vanilla's command tree |
|
||||
| `crates/horizon-client/src/command/vanilla_order.rs` | `generate_command_order.py` | command-parse harness export |
|
||||
| `crates/horizon-command/src/vanilla_order.rs` | `generate_command_order.py` | command-parse harness export |
|
||||
| `crates/horizon-world/src/datafix/block_state_data.txt` | `gen_block_state_data.py` | decompiled `BlockStateData` |
|
||||
| `crates/horizon-world/src/datafix/flat_tables.rs` | `gen_flat_tables.py` | 1.13 flattening fixers (never change) |
|
||||
|
||||
|
||||
Reference in New Issue
Block a user