cucina_vegana/init.lua

135 lines
3.7 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
**********************************************
If you want use cucina vegana with farming_redo from TenPlus, then set
farming_default = false
else true.
2018-12-26 22:48:38 +01:00
2018-04-22 23:18:59 +02:00
]]--
2018-05-02 17:36:51 +02:00
local plants = {}
2018-12-26 22:48:38 +01:00
local version = "1.2"
2018-05-02 17:36:51 +02:00
cucina_vegana_farming_default = true
2018-04-22 23:18:59 +02:00
local modpath = minetest.get_modpath(minetest.get_current_modname())
-- looking if farming_redo is activ?
2018-12-26 22:48:38 +01:00
if(farming.mod == "redo") then
cucina_vegana_farming_default = false
end
2018-05-02 17:36:51 +02:00
plants = {
["soy"] = true,
["parsley"] = true,
2018-05-02 23:21:56 +02:00
["lettuce"] =true,
2018-05-02 17:36:51 +02:00
["chives"] = true,
["rosemary"] = true,
["sunflower"] = true,
2018-05-02 23:21:56 +02:00
["kohlrabi"] = true,
2018-05-10 23:39:08 +02:00
["asparagus"] = true,
["rice"] = true
2018-05-02 23:21:56 +02:00
2018-05-02 17:36:51 +02:00
}
2018-04-22 23:18:59 +02:00
-- Load all flowers in default-mode
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
if (cucina_vegana_farming_default) then
dofile(modpath .. "/" .. pname .. "_default.lua")
dofile(modpath .. "/".. pname .. ".lua")
else
dofile(modpath .. "/" .. pname .. "_redo.lua")
dofile(modpath .. "/".. pname .. ".lua")
end -- if(cucina_vegana...)
end -- if(value)
print("[MOD] " .. minetest.get_current_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
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")
dofile(modpath .. "/overrides.lua")
2018-04-24 01:07:58 +02:00
-- *******************************************
-- ***** Technic-Support *****
-- *******************************************
2018-04-23 19:37:03 +02:00
if (minetest.get_modpath("technic")) then
-- Support Compressor
local compressor_recipes = {
{"cucina_vegana:sunflower_seeds 6", "cucina_vegana:sunflower_seeds_oil"},
{"cucina_vegana:lettuce_seed 6", "cucina_vegana:lettuce_oil"},
2018-07-07 13:28:10 +02:00
{"cucina_vegana:kohlrabi 6", "cucina_vegana:molasses"},
2018-04-23 19:37:03 +02:00
}
for _, data in pairs(compressor_recipes) do
technic.register_compressor_recipe({input = {data[1]}, output = data[2]})
end
-- Support Centrifuge
local centrifuge_recipes = {
{ "flowers:sunflower", "cucina_vegana:sunflower_seeds 4", "dye:yellow" },
{ "cucina_vegana:sunflower", "cucina_vegana:sunflower_seeds 4", "dye:yellow" },
2018-07-07 13:28:10 +02:00
{ "cucina_vegana:kohlrabi 4", "cucina_vegana:molasses", "default:leaves" },
2018-04-23 19:37:03 +02:00
}
for _, data in pairs(centrifuge_recipes) do
technic.register_separating_recipe({ input = { data[1] }, output = { data[2], data[3], data[4] } })
end
-- Support Extractor
local extractor_recipes = {
{"flowers:sunflower", "cucina_vegana:sunflower_seeds 4"},
{"cucina_vegana:sunflower", "cucina_vegana:sunflower_seeds 4"},
2018-07-07 13:28:10 +02:00
{"cucina_vegana:kohlrabi 3", "cucina_vegana:molasses"},
{"cucina_vegana:molasses", "bushes:sugar 2"},
2018-04-23 19:37:03 +02:00
}
for _, data in ipairs(extractor_recipes) do
technic.register_extractor_recipe({input = {data[1]}, output = data[2]})
end
end
if (cucina_vegana_farming_default) then
2018-05-04 00:42:56 +02:00
2018-12-25 01:01:52 +01:00
print("[MOD] " .. minetest.get_current_modname() .. " Version " .. version .. " in default-mode loaded.")
else
2018-12-25 01:01:52 +01:00
print("[MOD] " .. minetest.get_current_modname() .. " Version " .. version .. " in redo-mode loaded.")
end