mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 05:51:51 +00:00
add block data-fields to docs
This commit is contained in:
parent
6016433f47
commit
221a34fa2e
4 changed files with 106 additions and 0 deletions
|
|
@ -132,3 +132,27 @@ To use filter `dest` argument must be filled with some value(can be nil), it's d
|
|||
The function returns a table with the results or nil if the ray does not hit any block.
|
||||
|
||||
The result will use the destination table instead of creating a new one if the optional argument specified.
|
||||
|
||||
## Data fields
|
||||
|
||||
```lua
|
||||
-- writes a value to the specified block field
|
||||
-- * throws an exception if the types are incompatible
|
||||
-- * does nothing if the block does not have the field
|
||||
block.set_field(
|
||||
x: int, y: int, z: int,
|
||||
name: str,
|
||||
value: bool|int|number|string,
|
||||
[optional] index: int = 0
|
||||
)
|
||||
|
||||
-- returns the value written to the block field
|
||||
-- * returns nil if:
|
||||
-- 1. the field does not exist
|
||||
-- 2. no writes were made to any block field
|
||||
block.get_field(
|
||||
x: int, y: int, z: int,
|
||||
name: str,
|
||||
[optional] index: int = 0
|
||||
) -> the stored value or nil
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue