Make technic_worldgen loadable before technic

There was a small amount of dependency of technic_worldgen on the
technic mod, for configuration loading and the top-level "technic" table.
Resolve that by sharing the configuration and top-level table between the
two mods.  This means that technic_worldgen can be loaded before technic,
permitting other mods to depend on it without depending on technic.
This commit is contained in:
Zefram
2014-07-26 19:03:07 +01:00
parent dd65a68ce9
commit 9f0b41fe71
5 changed files with 19 additions and 10 deletions

View File

@ -0,0 +1,15 @@
technic.config = technic.config or Settings(minetest.get_worldpath().."/technic.conf")
local conf_table = technic.config:to_table()
local defaults = {
enable_granite_generation = "true",
enable_marble_generation = "true",
enable_rubber_tree_generation = "true",
}
for k, v in pairs(defaults) do
if conf_table[k] == nil then
technic.config:set(k, v)
end
end

View File

@ -1,4 +1,3 @@
default
technic
intllib?
mg?

View File

@ -1,5 +1,6 @@
local modpath = minetest.get_modpath("technic_worldgen")
technic = technic or {}
technic.worldgen = {}
if intllib then
technic.worldgen.gettext = intllib.Getter()
@ -7,6 +8,7 @@ else
technic.worldgen.gettext = function(s) return s end
end
dofile(modpath.."/config.lua")
dofile(modpath.."/nodes.lua")
dofile(modpath.."/oregen.lua")
dofile(modpath.."/crafts.lua")