1 -- Global farming namespace
3 farming.path = minetest.get_modpath("farming")
6 dofile(farming.path .. "/api.lua")
7 dofile(farming.path .. "/nodes.lua")
8 dofile(farming.path .. "/hoes.lua")
11 farming.register_plant("farming:wheat", {
12 description = "Wheat seed",
13 inventory_image = "farming_wheat_seed.png",
16 maxlight = default.LIGHT_MAX,
17 fertility = {"grassland"},
18 groups = {flammable = 4},
20 minetest.register_craftitem("farming:flour", {
21 description = "Flour",
22 inventory_image = "farming_flour.png",
23 groups = {flammable = 1},
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},
33 minetest.register_craft({
35 output = "farming:flour",
36 recipe = {"farming:wheat", "farming:wheat", "farming:wheat", "farming:wheat"}
39 minetest.register_craft({
42 output = "farming:bread",
43 recipe = "farming:flour"
47 farming.register_plant("farming:cotton", {
48 description = "Cotton seed",
49 inventory_image = "farming_cotton_seed.png",
52 maxlight = default.LIGHT_MAX,
53 fertility = {"grassland", "desert"},
54 groups = {flammable = 4},
57 minetest.register_alias("farming:string", "farming:cotton")
59 minetest.register_craft({
60 output = "wool:white",
62 {"farming:cotton", "farming:cotton"},
63 {"farming:cotton", "farming:cotton"},
68 minetest.register_craft({
69 output = "farming:straw 3",
71 {"farming:wheat", "farming:wheat", "farming:wheat"},
72 {"farming:wheat", "farming:wheat", "farming:wheat"},
73 {"farming:wheat", "farming:wheat", "farming:wheat"},
77 minetest.register_craft({
78 output = "farming:wheat 3",
85 minetest.register_craft({
87 recipe = "farming:straw",
91 minetest.register_craft({
93 recipe = "farming:wheat",
97 minetest.register_craft({
99 recipe = "farming:cotton",
103 minetest.register_craft({
105 recipe = "farming:hoe_wood",