init.lua 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. -- Global farming namespace
  2. farming = {}
  3. farming.path = minetest.get_modpath("farming")
  4. farming.config = minetest.get_mod_storage()
  5. farming.modname=minetest.get_current_modname()
  6. farming.mod = "redesign"
  7. local S = dofile(farming.path .. "/intllib.lua")
  8. farming.intllib = S
  9. minetest.log("action", "[MOD]"..minetest.get_current_modname().." -- start loading from "..minetest.get_modpath(minetest.get_current_modname()))
  10. -- Load files
  11. -- import settingtypes.txt
  12. basic_functions.import_settingtype(farming.path .. "/settingtypes.txt")
  13. dofile(farming.path .. "/api.lua") -- several helping functions
  14. dofile(farming.path .. "/config.lua") -- configuration of mod
  15. dofile(farming.path .. "/actions_register.lua") -- several actions defined
  16. dofile(farming.path .. "/nodes_register.lua") -- registering of nodes and items
  17. dofile(farming.path .. "/nodes.lua") --registering nodes
  18. dofile(farming.path .. "/tools_register.lua") --register functions for tools
  19. dofile(farming.path .. "/tools.lua") --define tools
  20. dofile(farming.path .. "/utensils.lua") -- utensils like grinder
  21. dofile(farming.path .. "/craft.lua") -- some craft definitions
  22. dofile(farming.path .. "/crops.lua") -- loading definition of crop and register
  23. dofile(farming.path .. "/abm.lua") -- abm functions
  24. dofile(farming.path .. "/compatibility.lua") -- Compatibility with other mods
  25. -- replacement LBM for pre-nodetimer plants
  26. minetest.register_lbm({
  27. name = ":farming:start_nodetimer_",
  28. nodenames = "groups:farming",
  29. action = function(pos, node)
  30. minetest.get_node_timer(pos):start(math.random(farming.wait_min,farming.wait_max))
  31. end,
  32. })
  33. minetest.log("action", "[MOD]"..minetest.get_current_modname().." -- loaded ")