]> git.lizzy.rs Git - hydra-dragonfire.git/blob - doc/map.md
Add map component
[hydra-dragonfire.git] / doc / map.md
1 # Map Component
2 Source code: [map.go](../map.go)
3
4 Map handles the `blk_data` and `node_metas_changed` packets.
5 Map may send `got_blks`, `deleted_blks` packets.
6
7 ## Functions
8
9 `self:clear()`: Forget all blocks.
10
11 `self:block(blkpos)`: Return the `map_blk` at `blkpos` as found in the `blk_data` packet (See [client_pkts.md](client_pkts.md)). `nil` if block is not present.
12
13 `self:node(pos)`: Return a node in the form `{ param0 = 126, param1 = 0, param2 = 0, meta = { ... } }`. The meta field is a `node_meta` as found in the `blk_data` packet. `nil` if node is not present.