-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsupport_mods.lua
executable file
·58 lines (41 loc) · 2.11 KB
/
support_mods.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
local af_items = {
-- Name Saturation Replace with Poison Heal Sound
-- crops
{'aqua_farming:alga_items', 1, nil, nil, nil, nil},
{'aqua_farming:sea_strawberry_item', 3, nil, nil, nil, nil},
{'aqua_farming:sea_anemone_item', 3, nil, nil, 1, nil},
{'aqua_farming:sea_cucumber_item', 4, nil, nil, nil, nil},
{'aqua_farming:sea_strawberry_cake_piece', 4, nil, nil, nil, nil},
}
-- *******************************************
-- ***** Hunger-Support *****
-- *******************************************
if(minetest.get_modpath("hunger")) then
for key, item in pairs(af_items) do
hunger.register_food(item)
end -- for key, data
end -- hunger
-- **********************************************
-- ***** Hunger_ng-Support *****
-- **********************************************
if(minetest.get_modpath("hunger_ng")) then
local add = hunger_ng.add_hunger_data
for key, item in pairs(af_items) do
add(item[1], {satiates = item[2], returns = item[3], heals = math.floor((item[5] or 0)), timeout = 0})
end -- for key, data
end -- hunger_ng
-- *******************************************
-- ***** Diet-Support *****
-- *******************************************
if(minetest.get_modpath("diet")) then
local function overwrite(name, hunger_change, replace_with_item, poisen, heal)
local tab = minetest.registered_items[name]
if not tab then
return
end
tab.on_use = diet.item_eat(hunger_change, replace_with_item, poisen, heal)
end -- local function overwrite
for key,item in pairs(af_items) do
overwrite(item[1], item[2], item[3], item[4], item[5])
end -- for key,item
end -- if(minetest.get_modpath("diet