Add and edit fuel registrations
[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         groups = {flammable = 4},
19 })
20 minetest.register_craftitem("farming:flour", {
21         description = "Flour",
22         inventory_image = "farming_flour.png",
23         groups = {flammable = 1},
24 })
25
26 minetest.register_craftitem("farming:bread", {
27         description = "Bread",
28         inventory_image = "farming_bread.png",
29         on_use = minetest.item_eat(5),
30         groups = {flammable = 2},
31 })
32
33 minetest.register_craft({
34         type = "shapeless",
35         output = "farming:flour",
36         recipe = {"farming:wheat", "farming:wheat", "farming:wheat", "farming:wheat"}
37 })
38
39 minetest.register_craft({
40         type = "cooking",
41         cooktime = 15,
42         output = "farming:bread",
43         recipe = "farming:flour"
44 })
45
46 -- Cotton
47 farming.register_plant("farming:cotton", {
48         description = "Cotton seed",
49         inventory_image = "farming_cotton_seed.png",
50         steps = 8,
51         minlight = 13,
52         maxlight = default.LIGHT_MAX,
53         fertility = {"grassland", "desert"},
54         groups = {flammable = 4},
55 })
56
57 minetest.register_alias("farming:string", "farming:cotton")
58
59 minetest.register_craft({
60         output = "wool:white",
61         recipe = {
62                 {"farming:cotton", "farming:cotton"},
63                 {"farming:cotton", "farming:cotton"},
64         }
65 })
66
67 -- Straw
68 minetest.register_craft({
69         output = "farming:straw 3",
70         recipe = {
71                 {"farming:wheat", "farming:wheat", "farming:wheat"},
72                 {"farming:wheat", "farming:wheat", "farming:wheat"},
73                 {"farming:wheat", "farming:wheat", "farming:wheat"},
74         }
75 })
76
77 minetest.register_craft({
78         output = "farming:wheat 3",
79         recipe = {
80                 {"farming:straw"},
81         }
82 })
83
84 -- Fuels
85 minetest.register_craft({
86         type = "fuel",
87         recipe = "farming:straw",
88         burntime = 3,
89 })
90
91 minetest.register_craft({
92         type = "fuel",
93         recipe = "farming:wheat",
94         burntime = 1,
95 })
96
97 minetest.register_craft({
98         type = "fuel",
99         recipe = "farming:cotton",
100         burntime = 1,
101 })
102
103 minetest.register_craft({
104         type = "fuel",
105         recipe = "farming:hoe_wood",
106         burntime = 5,
107 })