From bacec2c7e6024098ec6385377e27f3c63433ec80 Mon Sep 17 00:00:00 2001 From: AFCMS Date: Tue, 25 Oct 2022 00:32:35 +0200 Subject: [PATCH] Make 2 last params of `mcl_vars.get_node` optional --- mods/CORE/mcl_init/init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mods/CORE/mcl_init/init.lua b/mods/CORE/mcl_init/init.lua index 5f19044bb..9b74ad502 100644 --- a/mods/CORE/mcl_init/init.lua +++ b/mods/CORE/mcl_init/init.lua @@ -234,9 +234,10 @@ end ---"Trivial" (actually NOT) function to just read the node and some stuff to not just return "ignore", like mt 5.4 does. ---@param pos Vector Position, if it's wrong, `{name="error"}` node will return. ----@param force boolean Optional (default: `false`), Do the maximum to still read the node within us_timeout. ----@param us_timeout number Optional (default: `244 = 0.000244 s = 1/80/80/80`), set it at least to `3000000` to let mapgen to finish its job +---@param force? boolean Optional (default: `false`), Do the maximum to still read the node within us_timeout. +---@param us_timeout? number Optional (default: `244 = 0.000244 s = 1/80/80/80`), set it at least to `3000000` to let mapgen to finish its job ---@return node # Node definition, eg. `{name="air"}`. Unfortunately still can return `{name="ignore"}`. +---@nodiscard function mcl_vars.get_node(pos, force, us_timeout) -- check initial circumstances if not pos or not pos.x or not pos.y or not pos.z then return { name = "error" } end