From 834d624bfe76aeaa57c1bf18b94be8382ddfef74 Mon Sep 17 00:00:00 2001 From: alek13 Date: Wed, 11 Dec 2024 02:06:21 +0300 Subject: [PATCH] Effects System: ability to specify reason for effect & stop running effect early. Closes lord-server/lord#1825 --- minetest_ns.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/minetest_ns.lua b/minetest_ns.lua index 17c8465..ded8519 100644 --- a/minetest_ns.lua +++ b/minetest_ns.lua @@ -1654,6 +1654,8 @@ function minetest.sound_stop(handle) end --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5407-L5415) function minetest.sound_fade(handle, step, gain) end +--- @class job +local job = {} -- Timing: --- Returns job table to use as below. --- * Call the function `func` after `time` seconds, may be fractional @@ -1662,7 +1664,7 @@ function minetest.sound_fade(handle, step, gain) end --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5420-L5422) ---@param time number @in seconds ---@param func fun() ----@return table @job (job:cancel() to stop) +---@return job @job (job:cancel() to stop) function minetest.after(time, func, ...) end --- * Cancels the job function from being called function job:cancel() end