From 5dafdeea48f661cdfd6d5f0ddeafbcd611635d6c Mon Sep 17 00:00:00 2001 From: 1F616EMO Date: Sun, 1 Sep 2024 07:21:43 +0800 Subject: [PATCH] Move things from LDoc to game_api.txt --- game_api.txt | 8 ++++++++ mods/default/functions.lua | 5 ----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/game_api.txt b/game_api.txt index b3f6efc6..a67ff556 100644 --- a/game_api.txt +++ b/game_api.txt @@ -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 diff --git a/mods/default/functions.lua b/mods/default/functions.lua index 1f58af23..e13a7932 100644 --- a/mods/default/functions.lua +++ b/mods/default/functions.lua @@ -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