minetest_farming/init.lua

41 lines
1.6 KiB
Lua
Raw Normal View History

2018-09-17 20:26:04 -07:00
-- Global farming namespace
farming = {}
farming.path = minetest.get_modpath("farming")
2018-09-30 22:36:43 -07:00
farming.config = minetest.get_mod_storage()
farming.modname=minetest.get_current_modname()
2018-11-12 05:49:41 -08:00
farming.mod = "redesign"
2018-09-24 08:55:45 -07:00
local S = dofile(farming.path .. "/intllib.lua")
farming.intllib = S
2018-09-17 20:26:04 -07:00
2018-09-23 21:09:29 -07:00
minetest.log("action", "[MOD]"..minetest.get_current_modname().." -- start loading from "..minetest.get_modpath(minetest.get_current_modname()))
2018-09-17 20:26:04 -07:00
-- Load files
2018-12-23 01:18:59 -08:00
-- import settingtypes.txt
basic_functions.import_settingtype(farming.path .. "/settingtypes.txt")
2018-09-24 08:55:45 -07:00
2018-12-18 06:26:44 -08:00
dofile(farming.path .. "/api.lua") -- several helping functions
2018-10-29 20:35:28 -07:00
dofile(farming.path .. "/config.lua") -- configuration of mod
2018-09-30 22:36:43 -07:00
2018-10-29 07:52:00 -07:00
dofile(farming.path .. "/actions_register.lua") -- several actions defined
dofile(farming.path .. "/nodes_register.lua") -- registering of nodes and items
2018-10-29 20:35:28 -07:00
dofile(farming.path .. "/nodes.lua") --registering nodes
dofile(farming.path .. "/tools_register.lua") --register functions for tools
dofile(farming.path .. "/tools.lua") --define tools
dofile(farming.path .. "/utensils.lua") -- utensils like grinder
dofile(farming.path .. "/craft.lua") -- some craft definitions
dofile(farming.path .. "/crops.lua") -- loading definition of crop and register
dofile(farming.path .. "/abm.lua") -- abm functions
2018-12-30 03:23:59 -08:00
dofile(farming.path .. "/compatibility.lua") -- Compatibility with other mods
2018-09-17 20:26:04 -07:00
2018-10-08 09:01:52 -07:00
-- replacement LBM for pre-nodetimer plants
minetest.register_lbm({
name = ":farming:start_nodetimer_",
nodenames = "groups:farming",
action = function(pos, node)
minetest.get_node_timer(pos):start(math.random(farming.wait_min,farming.wait_max))
end,
})
2018-09-23 21:09:29 -07:00
minetest.log("action", "[MOD]"..minetest.get_current_modname().." -- loaded ")