Merge remote-tracking branch 'origin/main' into feat/server-mods-commands
# Conflicts: # crates/horizon-mods/src/lib.rs
This commit is contained in:
@@ -77,7 +77,7 @@ The mod's log, in the game's log under the mod's id. Always granted.
|
||||
|
||||
Access: capability `game-read`.
|
||||
|
||||
Capability `game-read`: the local player and the world clock.
|
||||
Capability `game-read`: the local player, the world clock and the block the player looks at.
|
||||
|
||||
### record `player`
|
||||
|
||||
@@ -99,10 +99,25 @@ Capability `game-read`: the local player and the world clock.
|
||||
| `game-time` | `u64` | Ticks since the world was created. |
|
||||
| `day-time` | `u64` | 24000 ticks per day; 0 is 6:00 on the first day. |
|
||||
|
||||
### record `hit`
|
||||
|
||||
A block along the player's view.
|
||||
|
||||
| Field | Type | |
|
||||
| --- | --- | --- |
|
||||
| `block-x` | `s32` | The block hit. |
|
||||
| `block-y` | `s32` | |
|
||||
| `block-z` | `s32` | |
|
||||
| `x` | `f64` | The point on its face where the view meets it. |
|
||||
| `y` | `f64` | |
|
||||
| `z` | `f64` | |
|
||||
| `block` | `string` | `minecraft:stone`, ... |
|
||||
|
||||
| Function | Signature | What it does |
|
||||
| --- | --- | --- |
|
||||
| `get-player` | `func() -> option<player>` | None on the title screen. |
|
||||
| `get-clock` | `func() -> option<clock>` | None on the title screen. |
|
||||
| `raycast` | `func(distance: f32) -> option<hit>` | The first block along the player's view (fluids pass), up to `distance` blocks (at most 1024; past the loaded chunks, across the distant terrain when LOD Distance is on), as of this tick. None when nothing is hit, and on the title screen. |
|
||||
|
||||
## `chat`
|
||||
|
||||
@@ -162,6 +177,7 @@ Capability `command`: vanilla commands run as the player, with the player's perm
|
||||
| Function | Signature | What it does |
|
||||
| --- | --- | --- |
|
||||
| `run` | `func(line: string)` | `line` without its slash; its feedback goes to the chat as if typed. |
|
||||
| `run-quiet` | `func(lines: list<string>)` | `lines` (each without its slash, at most 256 a call) as `run` does, but with nothing in the chat: no feedback and no failure. In single player and on Horizon's servers, each runs exactly as the player typing it would (the same rights), in order, 64 a tick, and the server logs one line a batch; one that carries a chat message (`say`, `msg`) is refused. On any other server they go as chat commands, and there their feedback shows: a mod running many should say so. |
|
||||
|
||||
## `ui`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user