2019-09-10 19:09:51 +02:00
|
|
|
-- farming/init.lua
|
|
|
|
|
|
|
|
-- Load support for MT game translation.
|
|
|
|
local S = minetest.get_translator("farming")
|
|
|
|
|
2014-04-16 23:44:58 +02:00
|
|
|
-- Global farming namespace
|
2017-08-14 17:19:53 +02:00
|
|
|
|
2013-08-30 10:10:30 +02:00
|
|
|
farming = {}
|
2014-04-16 23:44:58 +02:00
|
|
|
farming.path = minetest.get_modpath("farming")
|
2019-09-10 19:09:51 +02:00
|
|
|
farming.get_translator = S
|
2017-08-14 17:19:53 +02:00
|
|
|
|
2014-04-16 23:44:58 +02:00
|
|
|
-- Load files
|
2017-08-14 17:19:53 +02:00
|
|
|
|
2014-04-16 23:44:58 +02:00
|
|
|
dofile(farming.path .. "/api.lua")
|
|
|
|
dofile(farming.path .. "/nodes.lua")
|
|
|
|
dofile(farming.path .. "/hoes.lua")
|
2014-04-17 14:14:56 +02:00
|
|
|
|
2017-08-14 17:19:53 +02:00
|
|
|
|
2020-05-15 00:49:17 +02:00
|
|
|
-- Wheat
|
2017-08-14 17:19:53 +02:00
|
|
|
|
2014-04-16 23:44:58 +02:00
|
|
|
farming.register_plant("farming:wheat", {
|
2019-09-10 19:09:51 +02:00
|
|
|
description = S("Wheat Seed"),
|
2019-09-18 20:38:27 +02:00
|
|
|
harvest_description = S("Wheat"),
|
2016-12-03 08:39:25 +01:00
|
|
|
paramtype2 = "meshoptions",
|
2012-11-11 11:47:53 +01:00
|
|
|
inventory_image = "farming_wheat_seed.png",
|
2014-04-16 23:44:58 +02:00
|
|
|
steps = 8,
|
|
|
|
minlight = 13,
|
2014-12-07 15:17:09 +01:00
|
|
|
maxlight = default.LIGHT_MAX,
|
2016-10-24 20:34:00 +02:00
|
|
|
fertility = {"grassland"},
|
2018-04-04 10:59:15 +02:00
|
|
|
groups = {food_wheat = 1, flammable = 4},
|
2016-12-03 08:39:25 +01:00
|
|
|
place_param2 = 3,
|
2012-11-11 11:47:53 +01:00
|
|
|
})
|
2017-08-14 17:19:53 +02:00
|
|
|
|
2012-11-11 11:47:53 +01:00
|
|
|
minetest.register_craftitem("farming:flour", {
|
2019-09-10 19:09:51 +02:00
|
|
|
description = S("Flour"),
|
2012-11-11 11:47:53 +01:00
|
|
|
inventory_image = "farming_flour.png",
|
2018-04-04 10:59:15 +02:00
|
|
|
groups = {food_flour = 1, flammable = 1},
|
2012-11-11 11:47:53 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("farming:bread", {
|
2019-09-10 19:09:51 +02:00
|
|
|
description = S("Bread"),
|
2012-11-11 11:47:53 +01:00
|
|
|
inventory_image = "farming_bread.png",
|
2015-05-14 17:33:10 +02:00
|
|
|
on_use = minetest.item_eat(5),
|
2018-04-04 10:59:15 +02:00
|
|
|
groups = {food_bread = 1, flammable = 2},
|
2012-11-11 11:47:53 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
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"
|
|
|
|
})
|
|
|
|
|
2017-08-14 17:19:53 +02:00
|
|
|
|
2012-11-11 11:47:53 +01:00
|
|
|
-- Cotton
|
2017-08-14 17:19:53 +02:00
|
|
|
|
2014-04-16 23:44:58 +02:00
|
|
|
farming.register_plant("farming:cotton", {
|
2019-09-10 19:09:51 +02:00
|
|
|
description = S("Cotton Seed"),
|
2019-09-18 20:38:27 +02:00
|
|
|
harvest_description = S("Cotton"),
|
2012-11-11 11:47:53 +01:00
|
|
|
inventory_image = "farming_cotton_seed.png",
|
2014-04-16 23:44:58 +02:00
|
|
|
steps = 8,
|
|
|
|
minlight = 13,
|
2014-12-07 15:17:09 +01:00
|
|
|
maxlight = default.LIGHT_MAX,
|
2016-10-24 20:34:00 +02:00
|
|
|
fertility = {"grassland", "desert"},
|
|
|
|
groups = {flammable = 4},
|
2012-11-11 11:47:53 +01:00
|
|
|
})
|
|
|
|
|
2020-05-15 00:49:17 +02:00
|
|
|
minetest.register_decoration({
|
|
|
|
name = "farming:cotton_wild",
|
|
|
|
deco_type = "simple",
|
|
|
|
place_on = {"default:dry_dirt_with_dry_grass"},
|
|
|
|
sidelen = 16,
|
|
|
|
noise_params = {
|
|
|
|
offset = -0.1,
|
|
|
|
scale = 0.1,
|
|
|
|
spread = {x = 50, y = 50, z = 50},
|
|
|
|
seed = 4242,
|
|
|
|
octaves = 3,
|
|
|
|
persist = 0.7
|
|
|
|
},
|
|
|
|
biomes = {"savanna"},
|
|
|
|
y_max = 31000,
|
|
|
|
y_min = 1,
|
|
|
|
decoration = "farming:cotton_wild",
|
|
|
|
})
|
|
|
|
|
2017-08-14 17:19:53 +02:00
|
|
|
minetest.register_craftitem("farming:string", {
|
2019-09-10 19:09:51 +02:00
|
|
|
description = S("String"),
|
2017-08-14 17:19:53 +02:00
|
|
|
inventory_image = "farming_string.png",
|
|
|
|
groups = {flammable = 2},
|
|
|
|
})
|
2012-11-11 11:47:53 +01:00
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "wool:white",
|
|
|
|
recipe = {
|
2014-04-16 23:44:58 +02:00
|
|
|
{"farming:cotton", "farming:cotton"},
|
|
|
|
{"farming:cotton", "farming:cotton"},
|
2012-11-11 11:47:53 +01:00
|
|
|
}
|
|
|
|
})
|
2015-01-12 20:21:06 +01:00
|
|
|
|
2017-08-14 17:19:53 +02:00
|
|
|
minetest.register_craft({
|
|
|
|
output = "farming:string 2",
|
|
|
|
recipe = {
|
|
|
|
{"farming:cotton"},
|
|
|
|
{"farming:cotton"},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
|
2015-01-12 20:21:06 +01:00
|
|
|
-- Straw
|
2017-08-14 17:19:53 +02:00
|
|
|
|
2015-01-12 20:21:06 +01:00
|
|
|
minetest.register_craft({
|
|
|
|
output = "farming:straw 3",
|
|
|
|
recipe = {
|
|
|
|
{"farming:wheat", "farming:wheat", "farming:wheat"},
|
|
|
|
{"farming:wheat", "farming:wheat", "farming:wheat"},
|
|
|
|
{"farming:wheat", "farming:wheat", "farming:wheat"},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "farming:wheat 3",
|
|
|
|
recipe = {
|
|
|
|
{"farming:straw"},
|
|
|
|
}
|
|
|
|
})
|
Add and edit fuel registrations
Edited fuels: fences, wooden ladder.
New fuels:
boat, paper, book, dry shrub, stick, vessels shelf, wooden tools,
wooden door, trapdoor, fence gates, farming crops, stairs, slabs, beds.
2016-10-30 11:29:58 +01:00
|
|
|
|
2017-08-14 17:19:53 +02:00
|
|
|
|
Add and edit fuel registrations
Edited fuels: fences, wooden ladder.
New fuels:
boat, paper, book, dry shrub, stick, vessels shelf, wooden tools,
wooden door, trapdoor, fence gates, farming crops, stairs, slabs, beds.
2016-10-30 11:29:58 +01:00
|
|
|
-- Fuels
|
2017-08-14 17:19:53 +02:00
|
|
|
|
Add and edit fuel registrations
Edited fuels: fences, wooden ladder.
New fuels:
boat, paper, book, dry shrub, stick, vessels shelf, wooden tools,
wooden door, trapdoor, fence gates, farming crops, stairs, slabs, beds.
2016-10-30 11:29:58 +01:00
|
|
|
minetest.register_craft({
|
|
|
|
type = "fuel",
|
|
|
|
recipe = "farming:wheat",
|
|
|
|
burntime = 1,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
type = "fuel",
|
|
|
|
recipe = "farming:cotton",
|
|
|
|
burntime = 1,
|
|
|
|
})
|
|
|
|
|
2017-08-14 17:19:53 +02:00
|
|
|
minetest.register_craft({
|
|
|
|
type = "fuel",
|
|
|
|
recipe = "farming:string",
|
|
|
|
burntime = 1,
|
|
|
|
})
|
|
|
|
|
Add and edit fuel registrations
Edited fuels: fences, wooden ladder.
New fuels:
boat, paper, book, dry shrub, stick, vessels shelf, wooden tools,
wooden door, trapdoor, fence gates, farming crops, stairs, slabs, beds.
2016-10-30 11:29:58 +01:00
|
|
|
minetest.register_craft({
|
|
|
|
type = "fuel",
|
|
|
|
recipe = "farming:hoe_wood",
|
|
|
|
burntime = 5,
|
|
|
|
})
|
2020-02-23 14:41:13 +01:00
|
|
|
|
2020-05-15 00:49:17 +02:00
|
|
|
|
2020-02-23 14:41:13 +01:00
|
|
|
-- Register farming items as dungeon loot
|
2020-05-15 00:49:17 +02:00
|
|
|
|
2020-02-23 14:41:13 +01:00
|
|
|
if minetest.global_exists("dungeon_loot") then
|
|
|
|
dungeon_loot.register({
|
|
|
|
{name = "farming:string", chance = 0.5, count = {1, 8}},
|
|
|
|
{name = "farming:wheat", chance = 0.5, count = {2, 5}},
|
|
|
|
{name = "farming:seed_cotton", chance = 0.4, count = {1, 4},
|
|
|
|
types = {"normal"}},
|
|
|
|
})
|
|
|
|
end
|