forked from acmgit/cucina_vegana
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.lua
141 lines (106 loc) · 4.72 KB
/
init.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
--[[
**********************************************
*** 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. ***
*** ***
**********************************************
]]--
cucina_vegana = {}
cucina_vegana.version = "3.0"
cucina_vegana.farming_default = true
cucina_vegana.plant_settings = {}
cucina_vegana.plant_settings.bonemeal_list = {}
cucina_vegana.farming_ng = minetest.get_modpath("farming_nextgen")
cucina_vegana.signs_bot = minetest.get_modpath("signs_bot")
cucina_vegana.register_signs_bot = nil
cucina_vegana.plant_settings.germ_launch = 0
cucina_vegana.modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(minetest.get_current_modname())
local modname = cucina_vegana.modname
dofile(modpath .. "/settings.lua")
dofile(modpath .. "/tools.lua")
if(cucina_vegana.signs_bot) then
dofile(modpath .. "/register_signs_bot.lua")
end
local S
if(minetest.get_modpath("intllib")) then
S = dofile(modpath .."/intllib.lua")
print("[MOD] " .. modname .. ": translating in intllib-mode.")
elseif minetest.get_translator ~= nil then
S = minetest.get_translator("cucina_vegana")
print("[MOD] " .. modname .. ": translating in minetest-mode.")
else
S = function ( s ) return s end
end -- if(minetest.get_modpath(
cucina_vegana.get_translator = S
-- looking if farming_redo is activ?
if(farming.mod == "redo") then
cucina_vegana.farming_default = false
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"
local 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,
["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,
["banana"] = cucina_vegana.plant_settings.banana,
["tomato"] = cucina_vegana.plant_settings.tomato,
["potato"] = cucina_vegana.plant_settings.potato,
["carrot"] = cucina_vegana.plant_settings.carrot,
["garlic"] = cucina_vegana.plant_settings.garlic,
["chili"] = cucina_vegana.plant_settings.chili,
["onion"] = cucina_vegana.plant_settings.onion,
}
for pname, value in pairs(plants) do
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)
print("[MOD] " .. modname .. " Module: " .. pname .. " loaded.")
minetest.log("info", "[MOD] " .. modname .. " Module: " .. pname .. " loaded.")
end -- for
-- Insert Recipes
dofile(modpath .. "/overrides.lua")
dofile(modpath .. "/nodes.lua")
dofile(modpath .. "/items.lua")
dofile(modpath .. "/fuels.lua")
dofile(modpath .. "/recipes.lua")
dofile(modpath .. "/recipes_cook.lua")
dofile(modpath .. "/recipes_support.lua")
dofile(modpath .. "/recipes_5xx.lua") -- New recipes with MT 5.0
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
print("[MOD] " .. modname .. " Version " .. cucina_vegana.version .. " in default-mode loaded.")
minetest.log("info", "[MOD] " .. modname .. " Version " .. cucina_vegana.version .. " in default-mode loaded.")
else
print("[MOD] " .. modname .. " Version " .. cucina_vegana.version .. " in redo-mode loaded.")
minetest.log("info", "[MOD] " .. modname .. " Version " .. cucina_vegana.version .. " in redo-mode loaded.")
end