summaryrefslogtreecommitdiff
path: root/support.lua
blob: fe6022f8d235d9dbdb54577e251626ebe614f53d (plain)
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
-- RUBENFOOD MOD
-- A mod written by rubenwardy that adds
-- food to the minetest game
-- ======================================
-- >> rubenfood/support.lua
-- adds support for other mods
-- ======================================
-- [support]
-- ======================================

print "RubenFood [Support] - Initialising"
function node_implement(modname,n_ext,n_int,resultfunc)
         if not minetest.get_modpath(modname) then
            resultfunc()
         else
            minetest.register_alias(n_int,n_ext)
         end
end







print "RubenFood [Support] - Farming Mod"
node_implement("farming","farming:flour","rubenfood:flour",function()
   minetest.register_craftitem("rubenfood:flour", {
	description = "Flour",
	inventory_image = "farming_flour.png",
})
end)

node_implement("farming","farming:strawberry_item","rubenfood:strawberry",function()
minetest.register_craftitem("rubenfood:strawberry", {
	description = "Strawberry",
	inventory_image = "farming_strawberry.png",
	on_use = minetest.item_eat(2),
})
end)





print "RubenFood [Support] - Animal Mod"
node_implement("animalmaterials","animalmaterials:glass","rubenfood:cup",function()
   minetest.register_craftitem("rubenfood:cup",{
	description = "Glass",
	tiles = {"ruben_cup.png"},
	inventory_image = "ruben_cup.png",
})
end)

node_implement("animalmaterials","animalmaterials:egg","rubenfood:egg",function()
 minetest.register_craftitem("rubenfood:egg", {
	description = "Egg",
	image = "animalmaterials_egg.png",
	stack_max=10
})
end)

node_implement("animalmaterials","animalmaterials:milk","rubenfood:milk",function()
  minetest.register_craftitem("rubenfood:milk", {
	description = "Milk",
	image = "animalmaterials_milk.png",
	on_use = minetest.item_eat(1),
	groups = { eatable=1 },
	stack_max=10
})
end)