+--- WorldEdit mod for the Minetest engine\r
+-- @module worldedit\r
+-- @release 1.3\r
+-- @copyright 2012 sfan5, Anthony Zhang (Uberi/Temperest), and Brett O'Donnell (cornernote)\r
+-- @license GNU Affero General Public License version 3 (AGPLv3)\r
+-- @author sfan5\r
+-- @author Anthony Zang (Uberi/Temperest)\r
+-- @author Bret O'Donnel (cornernote)\r
+-- @author ShadowNinja\r
+\r
+\r
+worldedit = {}\r
+\r
+local ver = {major=1, minor=3}\r
+worldedit.version = ver\r
+worldedit.version_string = string.format("%d.%d", ver.major, ver.minor)\r
+\r
local path = minetest.get_modpath(minetest.get_current_modname())\r
\r
-local loadmodule = function(path)\r
- local results = {pcall(function()\r
- return dofile(path)\r
- end)}\r
- if results[1] then --successfully loaded module\r
- table.remove(results, 1) --remove status indicator\r
- return unpack(results) --return all results\r
- else --load error\r
- print(results[2])\r
- end\r
+local function load_module(path)\r
+ local file = io.open(path, "r")\r
+ if not file then return end\r
+ file:close()\r
+ return dofile(path)\r
+end\r
+\r
+dofile(path .. "/common.lua")\r
+load_module(path .. "/manipulations.lua")\r
+load_module(path .. "/primitives.lua")\r
+load_module(path .. "/visualization.lua")\r
+load_module(path .. "/serialization.lua")\r
+load_module(path .. "/code.lua")\r
+load_module(path .. "/compatibility.lua")\r
+load_module(path .. "/cuboid.lua")\r
+\r
+\r
+if minetest.settings:get_bool("log_mods") then\r
+ print("[WorldEdit] Loaded!")\r
end\r
\r
-loadmodule(path .. "/manipulations.lua")\r
-loadmodule(path .. "/primitives.lua")\r
-loadmodule(path .. "/visualization.lua")\r
-loadmodule(path .. "/serialization.lua")\r
-loadmodule(path .. "/code.lua")\r
-loadmodule(path .. "/compatibility.lua")\r
-loadmodule(path .. "/queue.lua")\r