]> git.lizzy.rs Git - skycraft.git/blobdiff - init.lua
Fixed Spawner Duplication bug
[skycraft.git] / init.lua
index 842cab82decddd1fb67bcc345594ce40101e2cca..ee2cc7831e0a2a5cd7cb023ae07d8aad1079a7f1 100755 (executable)
--- a/init.lua
+++ b/init.lua
@@ -1,5 +1,7 @@
 skycraft = {}
 
+skycraft.modpath = minetest.get_modpath("skycraft")
+
 do
        local file = io.open(minetest.get_worldpath() .. "/skycraft", "r")
        if file then
@@ -18,15 +20,10 @@ end)
 
 minetest.register_privilege("skycraft", "Use Skycraft commands")
 
-local modules = {
-       common = {"common", "random" , "request"},
-       main = {"commands", "flower_spread", "lobby", "lucky_block", "mapgen", "money", "plots", "ranks", "spawns", "tpa", "trade"},
-       onload = {"lava_cooling", "lobby_load", "nether_portal", "sapling_mutation", "shop", "spawn", "void"}
-}
-local modpath = minetest.get_modpath("skycraft")
+local modules = minetest.deserialize(io.open(skycraft.modpath .. "/modules.txt", "r"):read())
 local function load_module(m)
        for _, f in pairs(modules[m]) do
-               dofile(modpath .. "/src/" .. m .. "/" .. f .. ".lua")
+               dofile(skycraft.modpath .. "/src/" .. m .. "/" .. f .. ".lua")
        end
 end
 load_module("common")