=============\r
The WorldEdit API is composed of multiple modules, each of which is independent and can be used without the other. Each module is contained within a single file.\r
\r
+If needed, individual modules such as visualization.lua can be removed without affecting the rest of the program. The only file that cannot be removed is init.lua, which is necessary for the mod to run.\r
+\r
For more information, see the [README](README.md).\r
\r
Manipulations\r
+worldedit = worldedit or {}\r
+\r
worldedit.allocate_old = worldedit.allocate\r
worldedit.deserialize_old = worldedit.deserialize\r
worldedit.metasave = function(pos1, pos2, filename)\r
local path = minetest.get_modpath("worldedit")\r
-dofile(path .. "/manipulations.lua")\r
-dofile(path .. "/primitives.lua")\r
-dofile(path .. "/visualization.lua")\r
-dofile(path .. "/serialization.lua")\r
-dofile(path .. "/code.lua")\r
-dofile(path .. "/compatibility.lua")
\ No newline at end of file
+\r
+local loadmodule = function(path)\r
+ return pcall(function()\r
+ dofile(path)\r
+ end)\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")
\ No newline at end of file