2013-11-13 17:42:48 +01:00
|
|
|
cannons = {}
|
2013-12-02 15:55:22 +01:00
|
|
|
cannons.MODPATH = minetest.get_modpath(minetest.get_current_modname())
|
2014-07-27 09:24:33 +02:00
|
|
|
local worldpath = minetest.get_worldpath()
|
|
|
|
cannons.config = Settings(worldpath.."/cannons.conf")
|
2013-11-10 17:58:23 +01:00
|
|
|
|
2014-07-27 09:24:33 +02:00
|
|
|
local conf_table = cannons.config:to_table()
|
|
|
|
|
|
|
|
--look into readme.txt how to change settings
|
|
|
|
local defaults = {
|
2016-07-16 15:43:55 +02:00
|
|
|
enable_explosion = "true",
|
|
|
|
enable_fire = "true",
|
|
|
|
convert_old_nodes = "false",
|
2014-07-27 09:24:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
for k, v in pairs(defaults) do
|
2016-07-16 15:43:55 +02:00
|
|
|
if conf_table[k] == nil then
|
|
|
|
cannons.config:set(k, v)
|
|
|
|
end
|
2014-07-27 09:24:33 +02:00
|
|
|
end
|
2014-12-21 10:50:12 +01:00
|
|
|
|
2013-12-02 15:55:22 +01:00
|
|
|
dofile(cannons.MODPATH .."/functions.lua")
|
|
|
|
dofile(cannons.MODPATH .."/items.lua")
|
|
|
|
dofile(cannons.MODPATH .."/cannonballs.lua")
|
2013-10-12 12:24:24 +02:00
|
|
|
|
2016-07-16 15:43:55 +02:00
|
|
|
if cannons.config:get_bool("convert_old_nodes") then
|
2014-12-21 10:50:12 +01:00
|
|
|
dofile(cannons.MODPATH .."/convert.lua")
|
|
|
|
end
|
|
|
|
|
2016-07-16 15:43:55 +02:00
|
|
|
if minetest.get_modpath("tnt") then
|
2015-06-13 15:34:59 +02:00
|
|
|
minetest.log("info","TNT mod is aviable. registering some TNT stuff")
|
|
|
|
dofile(cannons.MODPATH .."/tnt.lua")
|
|
|
|
end
|
|
|
|
|
2016-07-16 15:43:55 +02:00
|
|
|
if minetest.get_modpath("locks") then
|
|
|
|
minetest.log("warning","locks mod enabled. dont execute locks.lua because this is an unstable beta version!")
|
2014-12-20 14:15:08 +01:00
|
|
|
--dofile(cannons.MODPATH .."/locks.lua")--if the locks mod is installed execute this file
|
2013-12-02 15:55:22 +01:00
|
|
|
end
|
2016-07-16 15:43:55 +02:00
|
|
|
if minetest.get_modpath("moreores") then
|
2013-12-05 03:01:21 +01:00
|
|
|
minetest.log("info","moreores mod enabled. execute moreores.lua")
|
|
|
|
dofile(cannons.MODPATH .."/moreores.lua")--if the moreores mod is installed execute this file
|
|
|
|
end
|
|
|
|
minetest.log("info", "[MOD]"..minetest.get_current_modname().." -- loaded from "..minetest.get_modpath(minetest.get_current_modname()))
|
2013-11-12 22:28:21 +01:00
|
|
|
|