From 7e5cace03486f3d7a4f2ac4b8c63fae5e09d6bec Mon Sep 17 00:00:00 2001 From: FatalErr42O <58855799+FatalError42O@users.noreply.github.com> Date: Fri, 5 Jan 2024 21:00:23 -0800 Subject: [PATCH] fixed dependency issues, removed table.lua, removed filesystem as a core dependency --- init.lua | 13 ++++++------- mod.conf | 8 ++++---- modlib/table.lua | 18 ------------------ 3 files changed, 10 insertions(+), 29 deletions(-) delete mode 100644 modlib/table.lua diff --git a/init.lua b/init.lua index f846de0..3e0f50c 100644 --- a/init.lua +++ b/init.lua @@ -1,10 +1,10 @@ -mtul = { - binary = {}, --provided entirely by modlib. - utils = {}, --provided entirely by modlib. - tbl = {}, --modified by libs.modlib, source. +mtul = mtul or { loaded_modules = {} } - +--initialize namespace vars if not present. +mtul.binary = mtul.binary or {} +mtul.utils = mtul.utils or {} +mtul.loaded_modules.filesystem = true --optionally allow user to overset local math with mtul while still keeping core funcs & consts. mtul.math = {} for i, v in pairs(math) do @@ -12,8 +12,7 @@ for i, v in pairs(math) do end --run files. These will directly modify the mtul sub tables. -mtul.path = minetest.get_modpath("mtul_core") +mtul.path = minetest.get_modpath("mtul_filesystem") dofile(mtul.path.."/modlib/binary.lua") -dofile(mtul.path.."/modlib/table.lua") dofile(mtul.path.."/modlib/mod_utils.lua") dofile(mtul.path.."/modlib/mod_utils_media.lua") diff --git a/mod.conf b/mod.conf index aa3771e..5b03917 100644 --- a/mod.conf +++ b/mod.conf @@ -1,4 +1,4 @@ -name = mtul_core -title = MTUL core -description = integrates various dependancies, implements some universal math features. -author = FatalError42O, Appgurue \ No newline at end of file +name = mtul_filesystem +title = MTUL filesystem +description = adds dependencies for binary file reading, as well as other file utilities. +author = FatalError42O, (coded by Appgurue) \ No newline at end of file diff --git a/modlib/table.lua b/modlib/table.lua deleted file mode 100644 index 8b8fe18..0000000 --- a/modlib/table.lua +++ /dev/null @@ -1,18 +0,0 @@ - ---adds a list to the end of another list without ovewriting data. -function mtul.tbl.append(table, other_table) - local length = #table - for index, value in ipairs(other_table) do - table[length + index] = value - end - return table -end - ---this... I guess lists keys by their order??? I have no idea, depended on by b3d standalone. -function mtul.tbl.keys(table) - local keys = {} - for key, _ in pairs(table) do - keys[#keys + 1] = key - end - return keys -end \ No newline at end of file