From: Elias Fleckenstein Date: Fri, 6 Aug 2021 17:22:31 +0000 (+0200) Subject: Add source code and include lua_async as submodule X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=cbef4c8f8dcbf88a81deba1e6b86bc5f26ab3316;p=lua_async_mt.git Add source code and include lua_async as submodule --- diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..b19cdff --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "src"] + path = src + url = https://github.com/EliasFleckenstein03/lua_async diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..256e3f0 --- /dev/null +++ b/init.lua @@ -0,0 +1,15 @@ +local path = minetest.get_modpath(minetest.get_current_modname()) .. "/src/" + +dofile(path .. "init.lua")(path) + +minetest.register_globalstep(function(dtime) + lua_async.step(dtime) +end) + +function lua_async.mt_validate_objs(...) + for _, ref in ipairs {...} do + if not ref:is_player() and not ref:get_luaentity() then + coroutine.yield(true) + end + end +end diff --git a/mod.conf b/mod.conf new file mode 100644 index 0000000..292859f --- /dev/null +++ b/mod.conf @@ -0,0 +1 @@ +name = lua_async diff --git a/src b/src new file mode 160000 index 0000000..a277029 --- /dev/null +++ b/src @@ -0,0 +1 @@ +Subproject commit a2770298f040307f8dd59c7a88d7e40d37faec14