Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

editGrid

editGrid<Values, Dimensions, Owner>(writer, entity, field): GridEditor<Values, Dimensions>

entity’s grid field, to edit: each set, fill and copyFrom is checked against the grid’s type and size and recorded, so the send carries one cell as one operation, and a collider built from the grid follows it on both ends. The writer is as editTrait’s. A refused writer, outside development, gets an editor that writes nowhere.

Type Parameter
Values extends GridArray
Dimensions extends 1 | 2 | 3
Owner extends UnstreamedTrait
Parameter Type
writer SetupWriter | EntityAuthority | SystemStep
entity Entity
field GridField<Values, Dimensions, Owner>

GridEditor<Values, Dimensions>

editGrid(step, chunk, ChunkTrait.fields.blocks).set(3, 9, 2, Block.Stone);

editGrid<Values, Dimensions, Owner>(writer, entity, field): GridEditor<Values, Dimensions>

entity’s grid field, to edit: each set, fill and copyFrom is checked against the grid’s type and size and recorded, so the send carries one cell as one operation, and a collider built from the grid follows it on both ends. The writer is as editTrait’s. A refused writer, outside development, gets an editor that writes nowhere.

Type Parameter
Values extends GridArray
Dimensions extends 1 | 2 | 3
Owner extends LocalTrait
Parameter Type
writer ViewWriter
entity Entity
field GridField<Values, Dimensions, Owner>

GridEditor<Values, Dimensions>

editGrid(step, chunk, ChunkTrait.fields.blocks).set(3, 9, 2, Block.Stone);

editGrid<Values, Dimensions, Owner>(writer, entity, field): GridEditor<Values, Dimensions>

entity’s grid field, to edit: each set, fill and copyFrom is checked against the grid’s type and size and recorded, so the send carries one cell as one operation, and a collider built from the grid follows it on both ends. The writer is as editTrait’s. A refused writer, outside development, gets an editor that writes nowhere.

Type Parameter
Values extends GridArray
Dimensions extends 1 | 2 | 3
Owner extends Trait
Parameter Type
writer SetupWriter | EntityAuthority
entity Entity
field GridField<Values, Dimensions, Owner>

GridEditor<Values, Dimensions>

editGrid(step, chunk, ChunkTrait.fields.blocks).set(3, 9, 2, Block.Stone);