Expand description
Mirrors (docs/design/bus.md, “Mirrors”): data read every tick kept in
shared memory. A mod declares the fields it reads (Declared: read in
place, released on drop) or provides a mirror (Registry::provide_mirror:
its writer is called when fields are due, with only those). Usually
through #[yog_mirror], which generates both sides typed.
Modules§
- host_
tables - The host’s mirrors: what the game itself writes (every entity, every
player), described once here — the runtime makes the Java host their
provider, Java’s constants are generated from these tables, and
yog_api’s typed structs are checked against them when they compile.
Structs§
- Block
Scope - The blocks of a box (both corners in): the host’s block mirror’s scope.
Its dimension is its key space’s (
yog:keys/block/<dimension>). - Block
Traits - A set of block traits.
- Blocks
- The blocks of the areas asked for, a dimension each: declared with
Blocks::declare_in(dimension, Some(&BlockScope { min, max }), …). - Client
Blocks - The blocks of the area asked for in this client’s world, by packed
position (
ClientBlocks::declare_scoped(&BlockScope { min, max }, …)): each one’s state and what a body meets there. - Client
Entities - The entities this client sees, by network id: written after its ticks, on any server.
- Declared
- Fields of a mirror asked for: written at the rate asked while this lives, read in place; dropped, what only it asked for stops.
- Entities
- Every live entity, by network id.
- Field
Spec - A mirror field.
- Mirror
Spec - A mirror:
yog:mirror/<mod>/<name>, rows of one key space. - Mirror
Writer - A typed provider’s turn.
- Mirrored
- A typed declaration: its rows read in place; dropped, released.
- Players
- Every player (part of the entities: their facts read through it).
- Row
- A row being read (what a generated view wraps).
- RowWriter
- A row being written (what a generated writer wraps).
- Writer
- A provider’s turn: the fields due, written for the rows it fills.
Enums§
- Clock
- Whose ticks a mirror is written after: the server’s (the world as it is), or a client’s (the world as that player sees it — what a client mod reads on any server).
- Kind
- The number a cell is made of.
- Rate
- How often a declaration wants its fields written.