config.lua 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. --[[
  2. Farming settings can be changed here and kept inside mod folder
  3. even after the mod has been updated, or you can place inside
  4. world folder for map specific settings.
  5. --]]
  6. local viscosity=1
  7. if minetest.settings:get("farming.rarety") then
  8. farming.config:set_float("rarety",minetest.settings:get("farming.rarety"))
  9. end
  10. if minetest.settings:get("farming.viscosity") then
  11. farming.config:set_int("viscosity",minetest.settings:get("farming.viscosity"))
  12. else
  13. farming.config:set_int("viscosity",viscosity)
  14. end
  15. -- rarety of crops on map, default is 0.001 (higher number = more crops)
  16. farming.rarety = tonumber(minetest.settings:get("farming.rarety")) or 0.002
  17. farming.viscosity = tonumber(minetest.settings:get("farming.viscosity")) or 1
  18. farming.wait_min = tonumber(minetest.settings:get("farming.wait_min")) or 60
  19. farming.wait_max = tonumber(minetest.settings:get("farming.wait_max")) or 70
  20. farming.wilt_removal_time = tonumber(minetest.settings:get("farming.wilt_removal_time")) or 40
  21. farming.wilt_time = tonumber(minetest.settings:get("farming.wilt_time")) or 90
  22. farming.min_light = tonumber(minetest.settings:get("farming.min_light")) or 10
  23. farming.health_threshold = tonumber(minetest.settings:get("farming.health_threshold")) or 50
  24. farming.factor_regrow = tonumber(minetest.settings:get("farming.factor_regrow")) or 2
  25. farming.abm_planting = tonumber(minetest.settings:get("farming.abm_planting")) or 30
  26. farming.abm_planting_change = tonumber(minetest.settings:get("farming.abm_planting_change")) or 750
  27. farming.registered_on_harvest={}
  28. -- node type, where grain can be randomly found
  29. farming.change_soil = {}
  30. local test_soil = {"default:dirt","default:dirt_with_grass","default:dirt_with_dry_grass","default:dirt_with_rainforest_litter",
  31. "default:dirt_with_coniferous_litter","default:permafrost_with_moss"}
  32. for i,s in ipairs(test_soil) do
  33. if minetest.registered_nodes[s] ~= nil then
  34. farming.add_soil(s)
  35. end
  36. end
  37. farming.change_soil_desert = {}
  38. local test_soil = {"default:desert_sand"}
  39. for i,s in ipairs(test_soil) do
  40. if minetest.registered_nodes[s] ~= nil then
  41. table.insert(farming.change_soil_desert,s)
  42. end
  43. end
  44. -- register for crops, which are spreading by abm
  45. farming.spreading_crops = {}
  46. -- register for crops
  47. farming.registered_plants = {}
  48. -- temp list for grass drop
  49. farming.grass_drop={max_items=1,items = {items={items={"default:grass_1"}}}}
  50. farming.junglegrass_drop={max_items=1,items = {items={items={"default:junglegrass"}}}}
  51. -- reading light statistics. needed for calculation of grow time
  52. farming.light_stat = basic_functions.import_csv(farming.path.."/light_stat.txt",{
  53. col_num={"day_start","amount","name"}})