cucina_vegana/init.lua

107 lines
3.5 KiB
Lua
Raw Normal View History

2018-04-22 23:18:59 +02:00
--[[
**********************************************
2018-12-25 01:01:52 +01:00
*** Cucina Vegana ***
*** ***
*** Cucina Vegana is a Mod for Minetest ***
*** and supports farming or farming_redo ***
*** by TenPlus. ***
*** ***
*** License: LGPL 3.0 by A.C.M. ***
*** ***
2018-04-22 23:18:59 +02:00
**********************************************
]]--
2018-05-02 17:36:51 +02:00
local plants = {}
2019-06-13 01:44:28 +02:00
local version = "2.2"
cucina_vegana_farming_default = true
cucina_vegana_plant_settings = {}
cucina_vegana_plant_settings.bonemeal_list = {}
2018-04-22 23:18:59 +02:00
local modpath = minetest.get_modpath(minetest.get_current_modname())
2019-01-13 20:14:07 +01:00
local modname = minetest.get_current_modname()
2018-04-22 23:18:59 +02:00
dofile(modpath .. "/settingtypes.lua")
-- looking if farming_redo is activ?
2018-12-26 22:48:38 +01:00
if(farming.mod == "redo") then
cucina_vegana_farming_default = false
2019-01-13 20:14:07 +01:00
minetest.log("info", "[MOD] " .. modname .. ": farming_redo mode activated.")
else
minetest.log("info", "[MOD] " .. modname .. ": default farming mode activated.")
end -- if(farming.mod
cucina_vegana_plant_settings.bonemeal = false -- Support for bonemeal disabled
if(minetest.get_modpath("bonemeal")) then
cucina_vegana_plant_settings.bonemeal = true
end -- if(minetest.get_modpath("bonemeal"
2019-01-13 20:14:07 +01:00
2018-05-02 17:36:51 +02:00
plants = {
["asparagus"] = cucina_vegana_plant_settings.asparagus,
["chives"] = cucina_vegana_plant_settings.chives,
["flax"] = cucina_vegana_plant_settings.flax,
["kohlrabi"] = cucina_vegana_plant_settings.kohlrabi,
["lettuce"] = cucina_vegana_plant_settings.lettuce,
2019-06-13 01:44:28 +02:00
["parsley"] = cucina_vegana_plant_settings.parsley,
["peanut"] = cucina_vegana_plant_settings.parsley,
["rosemary"] = cucina_vegana_plant_settings.rosemary,
["rice"] = cucina_vegana_plant_settings.rice,
["soy"] = cucina_vegana_plant_settings.soy,
["sunflower"] = cucina_vegana_plant_settings.sunflower,
2019-06-13 01:44:28 +02:00
2018-05-02 17:36:51 +02:00
}
2018-04-22 23:18:59 +02:00
2018-05-04 00:42:56 +02:00
for pname, value in pairs(plants) do
2018-04-27 00:13:34 +02:00
if(value) then
-- Load all flowers in default-mode
if (cucina_vegana_farming_default) then
dofile(modpath .. "/" .. pname .. "_default.lua")
dofile(modpath .. "/".. pname .. ".lua")
else
-- Load all flowers in redo-mode
dofile(modpath .. "/" .. pname .. "_redo.lua")
dofile(modpath .. "/".. pname .. ".lua")
end -- if(cucina_vegana...)
end -- if(value)
2019-01-13 20:14:07 +01:00
print("[MOD] " .. modname .. " Module: " .. pname .. " loaded.")
minetest.log("info", "[MOD] " .. modname .. " Module: " .. pname .. " loaded.")
2018-05-04 00:42:56 +02:00
end -- for
2018-04-22 23:18:59 +02:00
2018-04-24 01:07:58 +02:00
-- Insert Recipes
2019-01-13 20:14:07 +01:00
dofile(modpath .. "/overrides.lua")
2018-05-04 01:05:36 +02:00
dofile(modpath .. "/nodes.lua")
dofile(modpath .. "/items.lua")
dofile(modpath .. "/fuels.lua")
2018-04-24 01:07:58 +02:00
dofile(modpath .. "/recipes.lua")
2018-05-04 01:05:36 +02:00
dofile(modpath .. "/recipes_cook.lua")
2018-05-11 13:02:26 +02:00
dofile(modpath .. "/recipes_support.lua")
2019-02-14 16:45:33 +01:00
dofile(modpath .. "/recipes_5xx.lua") -- New recipes with MT 5.0
2019-01-06 17:20:25 +01:00
dofile(modpath .. "/register_mods.lua")
if(cucina_vegana_plant_settings.bonemeal) then
bonemeal:add_crop(cucina_vegana_plant_settings.bonemeal_list)
end -- if(cucina_vegana_plant_settings.bonemeal
if (cucina_vegana_farming_default) then
2019-01-13 20:14:07 +01:00
print("[MOD] " .. modname .. " Version " .. version .. " in default-mode loaded.")
minetest.log("info", "[MOD] " .. modname .. " Version " .. version .. " in default-mode loaded.")
else
2019-01-13 20:14:07 +01:00
print("[MOD] " .. modname .. " Version " .. version .. " in redo-mode loaded.")
minetest.log("info", "[MOD] " .. modname .. " Version " .. version .. " in redo-mode loaded.")
end