Dimension

Dimension

class

Playable surface holding the block world

Functions

Dimension:place(bpos, block, rotation)

Build a block the way a tool in hand builds one: the edit goes on the undo stack and out to the other peers. The cell has to be streamed in, so move the player there first. The block itself lands at the host's stamped tick, so read it back with get_block a tick later

bpos Vec3i Block position
block StaticBlock Block type to build
rotation FQuat? Rotation, nil for identity

returns boolean True when the edit was taken

Dimension:dig(bpos)

Break the block standing at the position the way a tool in hand breaks it: the edit goes on the undo stack and out to the other peers. The cell has to be streamed in, so move the player there first

bpos Vec3i Block position

returns boolean True when the edit was taken

Dimension:get_cell(bpos)

Block standing in the cell at the given position, nil when the cell is empty or its column is not loaded

bpos Vec3i Block position

returns StaticBlock Block type in the cell

Dimension:get_block(bpos)

Runtime block standing in the cell at the given position, nil when the cell is empty or its column is not loaded

bpos Vec3i Block position

returns BlockLogic Block logic in the cell

Dimension:sample_height(x, y)

Sample the terrain surface the generator builds at XY, in world cell coordinates. Surface rock detail can still raise the built ground a few cells above this

x number X coordinate in world cells
y number Y coordinate in world cells

returns number Surface height in cells, sea level at 0

Dimension:teleport(bpos)

Move the player to a block position, which moves the column streaming anchor with it

bpos Vec3i Block position

Dimension:get_produced(item)

How much of an item machines have produced on this surface over the whole save, zero for an item no machine has made yet

item StaticItem Item to count

returns number Units produced all time

Dimension:get_consumed(item)

How much of an item machines have used up on this surface over the whole save, zero for an item no machine has used yet

item StaticItem Item to count

returns number Units consumed all time

Dimension:spawn_point()

Block position the player spawns at

returns Vec3i Spawn position in block cells

Inherited from Actor (2)
Inherited from Object (5)