cucina_vegana/init.lua

135 lines
4.4 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
**********************************************
]]--
2019-07-02 21:38:03 +02:00
cucina_vegana = {}
2022-02-12 15:05:56 +01:00
cucina_vegana.version = "2.9"
2019-07-02 21:38:03 +02:00
cucina_vegana.farming_default = true
cucina_vegana.plant_settings = {}
cucina_vegana.plant_settings.bonemeal_list = {}
2020-03-04 21:18:20 +01:00
cucina_vegana.farming_ng = minetest.get_modpath("farming_nextgen")
2020-06-04 12:00:27 -05:00
cucina_vegana.signs_bot = minetest.get_modpath("signs_bot")
2020-11-22 15:08:40 +01:00
cucina_vegana.register_signs_bot = nil
2020-03-04 21:18:20 +01:00
cucina_vegana.plant_settings.germ_launch = 0
cucina_vegana.modname = minetest.get_current_modname()
2018-04-22 23:18:59 +02:00
local modpath = minetest.get_modpath(minetest.get_current_modname())
2020-03-04 21:18:20 +01:00
local modname = cucina_vegana.modname
2018-04-22 23:18:59 +02:00
2019-07-14 16:21:48 +02:00
dofile(modpath .. "/settings.lua")
dofile(modpath .. "/tools.lua")
2020-06-04 12:00:27 -05:00
2020-10-29 03:41:25 +01:00
if(cucina_vegana.signs_bot) then
2020-11-22 15:08:40 +01:00
dofile(modpath .. "/register_signs_bot.lua")
2020-10-29 03:41:25 +01:00
end
2020-06-04 12:00:27 -05:00
2019-11-21 17:24:41 +01:00
local S
if(minetest.get_modpath("intllib")) then
S = dofile(modpath .."/intllib.lua")
print("[MOD] " .. modname .. ": translating in intllib-mode.")
2019-12-28 03:46:36 +01:00
2020-03-04 21:18:20 +01:00
elseif minetest.get_translator ~= nil then
2019-11-21 17:24:41 +01:00
S = minetest.get_translator("cucina_vegana")
print("[MOD] " .. modname .. ": translating in minetest-mode.")
2019-12-28 03:46:36 +01:00
2020-03-04 21:18:20 +01:00
else
S = function ( s ) return s end
2020-03-11 06:04:39 +01:00
2019-11-21 17:24:41 +01:00
end -- if(minetest.get_modpath(
cucina_vegana.get_translator = S
-- looking if farming_redo is activ?
2018-12-26 22:48:38 +01:00
if(farming.mod == "redo") then
2019-07-02 21:38:03 +02:00
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
2019-07-02 21:38:03 +02:00
cucina_vegana.plant_settings.bonemeal = false -- Support for bonemeal disabled
if(minetest.get_modpath("bonemeal")) then
2019-07-02 21:38:03 +02:00
cucina_vegana.plant_settings.bonemeal = true
2019-07-16 22:59:13 +02:00
end -- if(minetest.get_modpath("bonemeal"
2019-01-13 20:14:07 +01:00
2019-07-17 22:44:09 +02:00
local plants = {
2018-05-02 17:36:51 +02:00
2019-07-02 21:38:03 +02:00
["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,
["parsley"] = cucina_vegana.plant_settings.parsley,
["peanut"] = cucina_vegana.plant_settings.peanut,
["rosemary"] = cucina_vegana.plant_settings.rosemary,
["rice"] = cucina_vegana.plant_settings.rice,
["soy"] = cucina_vegana.plant_settings.soy,
["sunflower"] = cucina_vegana.plant_settings.sunflower,
2022-02-12 14:00:09 +01:00
["banana"] = cucina_vegana.plant_settings.banana,
2018-05-02 17:36:51 +02:00
}
2019-07-16 22:59:13 +02:00
2018-04-22 23:18:59 +02:00
2020-06-04 12:00:27 -05:00
2018-05-04 00:42:56 +02:00
for pname, value in pairs(plants) do
2019-07-16 22:59:13 +02:00
if(value) then
-- Load all flowers in default-mode
2019-07-02 21:38:03 +02:00
if (cucina_vegana.farming_default) then
dofile(modpath .. "/" .. pname .. "_default.lua")
dofile(modpath .. "/".. pname .. ".lua")
2019-07-16 22:59:13 +02:00
else
-- Load all flowers in redo-mode
dofile(modpath .. "/" .. pname .. "_redo.lua")
dofile(modpath .. "/".. pname .. ".lua")
2019-07-16 22:59:13 +02:00
end -- if(cucina_vegana...)
end -- if(value)
2019-07-16 22:59:13 +02:00
2019-01-13 20:14:07 +01:00
print("[MOD] " .. modname .. " Module: " .. pname .. " loaded.")
minetest.log("info", "[MOD] " .. modname .. " Module: " .. pname .. " loaded.")
2019-07-16 22:59:13 +02:00
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")
2019-07-02 21:38:03 +02:00
if(cucina_vegana.plant_settings.bonemeal) then
bonemeal:add_crop(cucina_vegana.plant_settings.bonemeal_list)
2019-07-16 22:59:13 +02:00
2019-07-02 21:38:03 +02:00
end -- if(cucina_vegana.plant_settings.bonemeal
2019-07-02 21:38:03 +02:00
if (cucina_vegana.farming_default) then
print("[MOD] " .. modname .. " Version " .. cucina_vegana.version .. " in default-mode loaded.")
minetest.log("info", "[MOD] " .. modname .. " Version " .. cucina_vegana.version .. " in default-mode loaded.")
2019-07-16 22:59:13 +02:00
else
2019-07-02 21:38:03 +02:00
print("[MOD] " .. modname .. " Version " .. cucina_vegana.version .. " in redo-mode loaded.")
minetest.log("info", "[MOD] " .. modname .. " Version " .. cucina_vegana.version .. " in redo-mode loaded.")
2019-07-16 22:59:13 +02:00
end