123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- -- Global farming namespace
- farming = {}
- farming.path = minetest.get_modpath("farming")
- -- Load files
- dofile(farming.path .. "/api.lua")
- dofile(farming.path .. "/nodes.lua")
- dofile(farming.path .. "/hoes.lua")
- -- WHEAT
- farming.register_plant("farming:wheat", {
- description = "Wheat Seed",
- paramtype2 = "meshoptions",
- inventory_image = "farming_wheat_seed.png",
- steps = 8,
- minlight = 13,
- maxlight = default.LIGHT_MAX,
- fertility = {"grassland"},
- groups = {flammable = 4},
- place_param2 = 3,
- })
- minetest.register_craftitem("farming:flour", {
- description = "Flour",
- inventory_image = "farming_flour.png",
- groups = {flammable = 1},
- })
- minetest.register_craftitem("farming:bread", {
- description = "Bread",
- inventory_image = "farming_bread.png",
- on_use = minetest.item_eat(5),
- groups = {flammable = 2},
- })
- minetest.register_craft({
- type = "shapeless",
- output = "farming:flour",
- recipe = {"farming:wheat", "farming:wheat", "farming:wheat", "farming:wheat"}
- })
- minetest.register_craft({
- type = "cooking",
- cooktime = 15,
- output = "farming:bread",
- recipe = "farming:flour"
- })
- -- Cotton
- farming.register_plant("farming:cotton", {
- description = "Cotton Seed",
- inventory_image = "farming_cotton_seed.png",
- steps = 8,
- minlight = 13,
- maxlight = default.LIGHT_MAX,
- fertility = {"grassland", "desert"},
- groups = {flammable = 4},
- })
- minetest.register_craftitem("farming:string", {
- description = "String",
- inventory_image = "farming_string.png",
- groups = {flammable = 2},
- })
- minetest.register_craft({
- output = "wool:white",
- recipe = {
- {"farming:cotton", "farming:cotton"},
- {"farming:cotton", "farming:cotton"},
- }
- })
- minetest.register_craft({
- output = "farming:string 2",
- recipe = {
- {"farming:cotton"},
- {"farming:cotton"},
- }
- })
- -- rice
- farming.register_plant("farming:rice", {
- description = "Rice Seed",
- paramtype2 = "meshoptions",
- inventory_image = "farming_rice_seed.png",
- steps = 8,
- minlight = 13,
- maxlight = default.LIGHT_MAX,
- fertility = {"grassland"},
- groups = {flammable = 4},
- place_param2 = 3,
- })
- minetest.register_craftitem("farming:cooked_rice", {
- description = "Cooked Rice",
- inventory_image = "farming_rice.png",
- on_use = minetest.item_eat(2),
- })
- minetest.register_craft({
- type = "cooking",
- cooktime = 15,
- output = "farming:cooked_rice",
- recipe = "farming:rice"
- })
- -- Straw - uses dry grass not wheat
- minetest.register_craft({
- output = "farming:straw 3",
- recipe = {
- {"group:dry_grass", "group:dry_grass", "group:dry_grass"},
- {"group:dry_grass", "group:dry_grass", "group:dry_grass"},
- {"group:dry_grass", "group:dry_grass", "group:dry_grass"},
- }
- })
- minetest.register_craft({
- output = "default:dry_grass_1 3",
- recipe = {
- {"farming:straw"},
- }
- })
- -- Fuels
- minetest.register_craft({
- type = "fuel",
- recipe = "farming:straw",
- burntime = 3,
- })
- minetest.register_craft({
- type = "fuel",
- recipe = "farming:wheat",
- burntime = 1,
- })
- minetest.register_craft({
- type = "fuel",
- recipe = "farming:cotton",
- burntime = 1,
- })
- minetest.register_craft({
- type = "fuel",
- recipe = "farming:string",
- burntime = 1,
- })
- minetest.register_craft({
- type = "fuel",
- recipe = "farming:hoe_wood",
- burntime = 5,
- })
|