Default/functions: Reduce lavacooling ABM/sound overload
[oweals/minetest_game.git] / mods / farming / init.lua
1 -- Global farming namespace
2 farming = {}
3 farming.path = minetest.get_modpath("farming")
4
5 -- Load files
6 dofile(farming.path .. "/api.lua")
7 dofile(farming.path .. "/nodes.lua")
8 dofile(farming.path .. "/hoes.lua")
9
10 -- WHEAT
11 farming.register_plant("farming:wheat", {
12         description = "Wheat seed",
13         inventory_image = "farming_wheat_seed.png",
14         steps = 8,
15         minlight = 13,
16         maxlight = default.LIGHT_MAX,
17         fertility = {"grassland"}
18 })
19 minetest.register_craftitem("farming:flour", {
20         description = "Flour",
21         inventory_image = "farming_flour.png",
22 })
23
24 minetest.register_craftitem("farming:bread", {
25         description = "Bread",
26         inventory_image = "farming_bread.png",
27         on_use = minetest.item_eat(5),
28 })
29
30 minetest.register_craft({
31         type = "shapeless",
32         output = "farming:flour",
33         recipe = {"farming:wheat", "farming:wheat", "farming:wheat", "farming:wheat"}
34 })
35
36 minetest.register_craft({
37         type = "cooking",
38         cooktime = 15,
39         output = "farming:bread",
40         recipe = "farming:flour"
41 })
42
43 -- Cotton
44 farming.register_plant("farming:cotton", {
45         description = "Cotton seed",
46         inventory_image = "farming_cotton_seed.png",
47         steps = 8,
48         minlight = 13,
49         maxlight = default.LIGHT_MAX,
50         fertility = {"grassland", "desert"}
51 })
52
53 minetest.register_alias("farming:string", "farming:cotton")
54
55 minetest.register_craft({
56         output = "wool:white",
57         recipe = {
58                 {"farming:cotton", "farming:cotton"},
59                 {"farming:cotton", "farming:cotton"},
60         }
61 })
62
63 -- Straw
64 minetest.register_craft({
65         output = "farming:straw 3",
66         recipe = {
67                 {"farming:wheat", "farming:wheat", "farming:wheat"},
68                 {"farming:wheat", "farming:wheat", "farming:wheat"},
69                 {"farming:wheat", "farming:wheat", "farming:wheat"},
70         }
71 })
72
73 minetest.register_craft({
74         output = "farming:wheat 3",
75         recipe = {
76                 {"farming:straw"},
77         }
78 })