]> git.lizzy.rs Git - lua_async_mt.git/commitdiff
Add source code and include lua_async as submodule
authorElias Fleckenstein <eliasfleckenstein@web.de>
Fri, 6 Aug 2021 17:22:31 +0000 (19:22 +0200)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Fri, 6 Aug 2021 17:22:31 +0000 (19:22 +0200)
.gitmodules [new file with mode: 0644]
init.lua [new file with mode: 0644]
mod.conf [new file with mode: 0644]
src [new submodule]

diff --git a/.gitmodules b/.gitmodules
new file mode 100644 (file)
index 0000000..b19cdff
--- /dev/null
@@ -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 (file)
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 (file)
index 0000000..292859f
--- /dev/null
+++ b/mod.conf
@@ -0,0 +1 @@
+name = lua_async
diff --git a/src b/src
new file mode 160000 (submodule)
index 0000000..a277029
--- /dev/null
+++ b/src
@@ -0,0 +1 @@
+Subproject commit a2770298f040307f8dd59c7a88d7e40d37faec14