1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Add Lua API function to resolve node/collision/selection boxes (#13964)

This commit is contained in:
grorp 2024-02-06 20:45:16 +01:00 committed by GitHub
parent 4859cf44ce
commit f2b99332d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 159 additions and 28 deletions

View file

@ -6183,6 +6183,17 @@ Environment access
* increase level of leveled node by level, default `level` equals `1`
* if `totallevel > maxlevel`, returns rest (`total-max`)
* `level` must be between -127 and 127
* `minetest.get_node_boxes(box_type, pos, [node])`
* `box_type` must be `"node_box"`, `"collision_box"` or `"selection_box"`.
* `pos` must be a node position.
* `node` can be a table in the form `{name=string, param1=number, param2=number}`.
If `node` is `nil`, the actual node at `pos` is used instead.
* Resolves any facedir-rotated boxes, connected boxes and the like into
actual boxes.
* Returns a list of boxes in the form
`{{x1, y1, z1, x2, y2, z2}, {x1, y1, z1, x2, y2, z2}, ...}`. Coordinates
are relative to `pos`.
* See also: [Node boxes](#node-boxes)
* `minetest.fix_light(pos1, pos2)`: returns `true`/`false`
* resets the light in a cuboid-shaped part of
the map and removes lighting bugs.