Move things from LDoc to game_api.txt

This commit is contained in:
1F616EMO 2024-09-01 07:21:43 +08:00
parent b5c297c1b7
commit 5dafdeea48
No known key found for this signature in database
GPG key ID: EF52EFA8E05859B2
2 changed files with 8 additions and 5 deletions

View file

@ -1215,3 +1215,11 @@ These can be influenced using this API.
* `player`: ObjectRef of the relevant player
* You can override this function to change the weather effects by simply returning different values.
Setting `clouds` or `lighting` in the result table to `nil` will *prevent* those from changing.
Utilities
---------
`default.dig_up(pos, node, digger, max_height)`
* Find all nodes above `pos` that is the same, then dig them all
* `max_height` Maximum number of nodes to iterate. Default: 100

View file

@ -295,11 +295,6 @@ minetest.register_abm({
local in_dig_up = false
---Find all nodes above this one that is the same, then dig them all
---@param pos vector The position of the base node
---@param node { name: string, param1: integer, param2: integer } Node table of the base node
---@param digger ObjectRef The object (e.g. player) digging the node
---@param max_height The maximum height to search for, excluding the base node
function default.dig_up(pos, node, digger, max_height)
if in_dig_up then return end -- Do not recurse
if digger == nil then return end