forked from mtcontrib/farming
		
	add helper function to add {eatable}
This commit is contained in:
		| @@ -3,10 +3,10 @@ local S = farming.translate | ||||
|  | ||||
| -- item definition | ||||
| minetest.register_craftitem("farming:artichoke", { | ||||
| 	description = S("Artichoke") .. " (♥4)", | ||||
| 	description = S("Artichoke"), | ||||
| 	inventory_image = "farming_artichoke.png", | ||||
| 	groups = { | ||||
| 		compostability = 48, seed = 2, food_artichoke = 1, flammable = 2, eatable = 4 | ||||
| 		compostability = 48, seed = 2, food_artichoke = 1, flammable = 2 | ||||
| 	}, | ||||
| 	on_place = function(itemstack, placer, pointed_thing) | ||||
| 		return farming.place_seed(itemstack, placer, pointed_thing, "farming:artichoke_1") | ||||
| @@ -14,6 +14,8 @@ minetest.register_craftitem("farming:artichoke", { | ||||
| 	on_use = minetest.item_eat(4) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:artichoke", 4) | ||||
|  | ||||
| -- crop definition | ||||
| local def = { | ||||
| 	drawtype = "plantlike", | ||||
|   | ||||
| @@ -3,10 +3,10 @@ local S = farming.translate | ||||
|  | ||||
| -- asparagus | ||||
| minetest.register_craftitem("farming:asparagus", { | ||||
| 	description = S("Asparagus") .. " (♥1)", | ||||
| 	description = S("Asparagus"), | ||||
| 	inventory_image = "farming_asparagus.png", | ||||
| 	groups = { | ||||
| 		compostability = 48, seed = 2, food_asparagus = 1, flammable = 2, eatable = 1 | ||||
| 		compostability = 48, seed = 2, food_asparagus = 1, flammable = 2 | ||||
| 	}, | ||||
| 	on_place = function(itemstack, placer, pointed_thing) | ||||
| 		return farming.place_seed(itemstack, placer, pointed_thing, "farming:asparagus_1") | ||||
| @@ -14,6 +14,8 @@ minetest.register_craftitem("farming:asparagus", { | ||||
| 	on_use = minetest.item_eat(1) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:asparagus", 1) | ||||
|  | ||||
| -- asparagus definition | ||||
| local def = { | ||||
| 	drawtype = "plantlike", | ||||
|   | ||||
| @@ -70,15 +70,17 @@ end | ||||
|  | ||||
| -- beans | ||||
| minetest.register_craftitem("farming:beans", { | ||||
| 	description = S("Green Beans" .. " (♥1)"), | ||||
| 	description = S("Green Beans"), | ||||
| 	inventory_image = "farming_beans.png", | ||||
| 	groups = {compostability = 48, seed = 2, food_beans = 1, flammable = 2, eatable = 1}, | ||||
| 	groups = {compostability = 48, seed = 2, food_beans = 1, flammable = 2}, | ||||
| 	on_use = minetest.item_eat(1), | ||||
| 	on_place = function(itemstack, placer, pointed_thing) | ||||
| 		return place_beans(itemstack, placer, pointed_thing, "farming:beanpole_1") | ||||
| 	end | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:beans", 1) | ||||
|  | ||||
| -- beans can be used for green dye | ||||
| minetest.register_craft({ | ||||
| 	output = a.dye_green, | ||||
|   | ||||
| @@ -4,10 +4,10 @@ local a = farming.recipe_items | ||||
|  | ||||
| -- beetroot | ||||
| minetest.register_craftitem("farming:beetroot", { | ||||
| 	description = S("Beetroot") .. " (♥1)", | ||||
| 	description = S("Beetroot"), | ||||
| 	inventory_image = "farming_beetroot.png", | ||||
| 	groups = { | ||||
| 		compostability = 48, seed = 2, food_beetroot = 1, flammable = 2, eatable = 1 | ||||
| 		compostability = 48, seed = 2, food_beetroot = 1, flammable = 2 | ||||
| 	}, | ||||
| 	on_place = function(itemstack, placer, pointed_thing) | ||||
| 		return farming.place_seed(itemstack, placer, pointed_thing, "farming:beetroot_1") | ||||
| @@ -15,14 +15,18 @@ minetest.register_craftitem("farming:beetroot", { | ||||
| 	on_use = minetest.item_eat(1) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:beetroot", 1) | ||||
|  | ||||
| -- beetroot soup | ||||
| minetest.register_craftitem("farming:beetroot_soup", { | ||||
| 	description = S("Beetroot Soup") .. " (♥6)", | ||||
| 	description = S("Beetroot Soup"), | ||||
| 	inventory_image = "farming_beetroot_soup.png", | ||||
| 	groups = {flammable = 2, eatable = 6}, | ||||
| 	groups = {flammable = 2}, | ||||
| 	on_use = minetest.item_eat(6, "farming:bowl") | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:beetroot_soup", 6) | ||||
|  | ||||
| minetest.register_craft({ | ||||
| 	output = "farming:beetroot_soup", | ||||
| 	recipe = { | ||||
|   | ||||
| @@ -3,11 +3,11 @@ local S = farming.translate | ||||
|  | ||||
| -- blackberries | ||||
| minetest.register_craftitem("farming:blackberry", { | ||||
| 	description = S("Blackberries" .. " (♥1)"), | ||||
| 	description = S("Blackberries"), | ||||
| 	inventory_image = "farming_blackberry.png", | ||||
| 	groups = { | ||||
| 		compostability = 48, seed = 2, food_blackberries = 1, food_blackberry = 1, | ||||
| 		food_berry = 1, flammable = 2, eatable = 1 | ||||
| 		food_berry = 1, flammable = 2 | ||||
| 	}, | ||||
| 	on_place = function(itemstack, placer, pointed_thing) | ||||
| 		return farming.place_seed(itemstack, placer, pointed_thing, "farming:blackberry_1") | ||||
| @@ -15,6 +15,8 @@ minetest.register_craftitem("farming:blackberry", { | ||||
| 	on_use = minetest.item_eat(1) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:blackberry", 1) | ||||
|  | ||||
| local def = { | ||||
| 	drawtype = "plantlike", | ||||
| 	tiles = {"farming_blackberry_1.png"}, | ||||
|   | ||||
| @@ -4,11 +4,11 @@ local a = farming.recipe_items | ||||
|  | ||||
| -- blueberries | ||||
| minetest.register_craftitem("farming:blueberries", { | ||||
| 	description = S("Wild Blueberries") .. " (♥1)", | ||||
| 	description = S("Wild Blueberries"), | ||||
| 	inventory_image = "farming_blueberries.png", | ||||
| 	groups = { | ||||
| 		compostability = 48,seed = 2, food_blueberries = 1, food_blueberry = 1, | ||||
| 		food_berry = 1, flammable = 2, eatable = 1 | ||||
| 		food_berry = 1, flammable = 2 | ||||
| 	}, | ||||
| 	on_place = function(itemstack, placer, pointed_thing) | ||||
| 		return farming.place_seed(itemstack, placer, pointed_thing, "farming:blueberry_1") | ||||
| @@ -16,14 +16,18 @@ minetest.register_craftitem("farming:blueberries", { | ||||
| 	on_use = minetest.item_eat(1) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:blueberries", 1) | ||||
|  | ||||
| -- blueberry muffin (thanks to sosogirl123 @ deviantart.com for muffin image) | ||||
| minetest.register_craftitem("farming:muffin_blueberry", { | ||||
| 	description = S("Blueberry Muffin") .. " (♥2)", | ||||
| 	description = S("Blueberry Muffin"), | ||||
| 	inventory_image = "farming_blueberry_muffin.png", | ||||
| 	on_use = minetest.item_eat(2), | ||||
| 	groups = {compostability = 65, eatable = 2} | ||||
| 	groups = {compostability = 65} | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:muffin_blueberry", 2) | ||||
|  | ||||
| minetest.register_craft({ | ||||
| 	output = "farming:muffin_blueberry 2", | ||||
| 	recipe = { | ||||
| @@ -33,12 +37,14 @@ minetest.register_craft({ | ||||
|  | ||||
| -- Blueberry Pie | ||||
| minetest.register_craftitem("farming:blueberry_pie", { | ||||
| 	description = S("Blueberry Pie") .. " (♥6)", | ||||
| 	description = S("Blueberry Pie"), | ||||
| 	inventory_image = "farming_blueberry_pie.png", | ||||
| 	on_use = minetest.item_eat(6), | ||||
| 	groups = {compostability = 75, eatable = 6} | ||||
| 	groups = {compostability = 75} | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:blueberry_pie", 6) | ||||
|  | ||||
| minetest.register_craft({ | ||||
| 	output = "farming:blueberry_pie", | ||||
| 	recipe = { | ||||
|   | ||||
| @@ -3,10 +3,10 @@ local S = farming.translate | ||||
|  | ||||
| -- cabbage | ||||
| minetest.register_craftitem("farming:cabbage", { | ||||
| 	description = S("Cabbage") .. " (♥1)", | ||||
| 	description = S("Cabbage"), | ||||
| 	inventory_image = "farming_cabbage.png", | ||||
| 	groups = { | ||||
| 		compostability = 48, seed = 2, food_cabbage = 1, flammable = 2, eatable = 1 | ||||
| 		compostability = 48, seed = 2, food_cabbage = 1, flammable = 2 | ||||
| 	}, | ||||
| 	on_place = function(itemstack, placer, pointed_thing) | ||||
| 		return farming.place_seed(itemstack, placer, pointed_thing, "farming:cabbage_1") | ||||
| @@ -14,6 +14,8 @@ minetest.register_craftitem("farming:cabbage", { | ||||
| 	on_use = minetest.item_eat(1) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:cabbage", 1) | ||||
|  | ||||
| local def = { | ||||
| 	drawtype = "plantlike", | ||||
| 	tiles = {"farming_cabbage_1.png"}, | ||||
|   | ||||
| @@ -9,10 +9,10 @@ local a = farming.recipe_items | ||||
|  | ||||
| -- carrot | ||||
| minetest.register_craftitem("farming:carrot", { | ||||
| 	description = S("Carrot") .. " (♥4)", | ||||
| 	description = S("Carrot"), | ||||
| 	inventory_image = "farming_carrot.png", | ||||
| 	groups = { | ||||
| 		compostability = 48, seed = 2, food_carrot = 1, flammable = 2, eatable = 4 | ||||
| 		compostability = 48, seed = 2, food_carrot = 1, flammable = 2 | ||||
| 	}, | ||||
| 	on_place = function(itemstack, placer, pointed_thing) | ||||
| 		return farming.place_seed(itemstack, placer, pointed_thing, "farming:carrot_1") | ||||
| @@ -20,14 +20,18 @@ minetest.register_craftitem("farming:carrot", { | ||||
| 	on_use = minetest.item_eat(4) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:carrot", 4) | ||||
|  | ||||
| -- carrot juice | ||||
| minetest.register_craftitem("farming:carrot_juice", { | ||||
| 	description = S("Carrot Juice") .. " (♥4)", | ||||
| 	description = S("Carrot Juice"), | ||||
| 	inventory_image = "farming_carrot_juice.png", | ||||
| 	on_use = minetest.item_eat(4, "vessels:drinking_glass"), | ||||
| 	groups = {vessel = 1, drink = 1, eatable = 4} | ||||
| 	groups = {vessel = 1, drink = 1} | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:carrot_juice", 4) | ||||
|  | ||||
| minetest.register_craft({ | ||||
| 	output = "farming:carrot_juice", | ||||
| 	recipe = { | ||||
| @@ -42,12 +46,14 @@ minetest.register_craft({ | ||||
|  | ||||
| -- golden carrot | ||||
| minetest.register_craftitem("farming:carrot_gold", { | ||||
| 	description = S("Golden Carrot") .. " (♥10)", | ||||
| 	description = S("Golden Carrot"), | ||||
| 	inventory_image = "farming_carrot_gold.png", | ||||
| 	on_use = minetest.item_eat(10), | ||||
| 	groups = {eatable = 10} | ||||
| 	groups = {flammable = 2} | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:carrot_gold", 10) | ||||
|  | ||||
| minetest.register_craft({ | ||||
| 	output = "farming:carrot_gold", | ||||
| 	recipe = {{"group:food_carrot", "default:gold_lump"}} | ||||
|   | ||||
| @@ -4,10 +4,10 @@ local a = farming.recipe_items | ||||
|  | ||||
| -- chili pepper | ||||
| minetest.register_craftitem("farming:chili_pepper", { | ||||
| 	description = S("Chili Pepper") .. " (♥2)", | ||||
| 	description = S("Chili Pepper"), | ||||
| 	inventory_image = "farming_chili_pepper.png", | ||||
| 	groups = { | ||||
| 		compostability = 48, seed = 2, food_chili_pepper = 1, flammable = 4, eatable = 2 | ||||
| 		compostability = 48, seed = 2, food_chili_pepper = 1, flammable = 4 | ||||
| 	}, | ||||
| 	on_place = function(itemstack, placer, pointed_thing) | ||||
| 		return farming.place_seed(itemstack, placer, pointed_thing, "farming:chili_1") | ||||
| @@ -15,14 +15,18 @@ minetest.register_craftitem("farming:chili_pepper", { | ||||
| 	on_use = minetest.item_eat(2) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:chili_pepper", 2) | ||||
|  | ||||
| -- bowl of chili | ||||
| minetest.register_craftitem("farming:chili_bowl", { | ||||
| 	description = S("Bowl of Chili") .. " (♥8)", | ||||
| 	description = S("Bowl of Chili"), | ||||
| 	inventory_image = "farming_chili_bowl.png", | ||||
| 	on_use = minetest.item_eat(8, a.bowl), | ||||
| 	groups = {compostability = 65, eatable = 8} | ||||
| 	groups = {compostability = 65} | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:chili_bowl", 8) | ||||
|  | ||||
| minetest.register_craft({ | ||||
| 	output = "farming:chili_bowl", | ||||
| 	recipe = { | ||||
|   | ||||
| @@ -94,12 +94,14 @@ minetest.register_craft( { | ||||
|  | ||||
| -- chocolate cookie | ||||
| minetest.register_craftitem("farming:cookie", { | ||||
| 	description = S("Cookie") .. " (♥2)", | ||||
| 	description = S("Cookie"), | ||||
| 	inventory_image = "farming_cookie.png", | ||||
| 	on_use = minetest.item_eat(2), | ||||
| 	groups = {eatable = 2} | ||||
| 	groups = {flammable = 2} | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:cookie", 2) | ||||
|  | ||||
| minetest.register_craft( { | ||||
| 	output = "farming:cookie 8", | ||||
| 	recipe = { | ||||
| @@ -109,12 +111,14 @@ minetest.register_craft( { | ||||
|  | ||||
| -- bar of dark chocolate (thanks to Ice Pandora for her deviantart.com chocolate tutorial) | ||||
| minetest.register_craftitem("farming:chocolate_dark", { | ||||
| 	description = S("Bar of Dark Chocolate") .. " (♥3)", | ||||
| 	description = S("Bar of Dark Chocolate"), | ||||
| 	inventory_image = "farming_chocolate_dark.png", | ||||
| 	on_use = minetest.item_eat(3), | ||||
| 	groups = {eatable = 3} | ||||
| 	groups = {flammable = 2} | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:chocolate_dark", 3) | ||||
|  | ||||
| minetest.register_craft( { | ||||
| 	output = "farming:chocolate_dark", | ||||
| 	recipe = { | ||||
|   | ||||
| @@ -14,7 +14,7 @@ minetest.register_craftitem("farming:coffee_beans", { | ||||
|  | ||||
| -- cup of coffee | ||||
| minetest.register_node("farming:coffee_cup", { | ||||
| 	description = S("Cup of Coffee") .. " (♥2)", | ||||
| 	description = S("Cup of Coffee"), | ||||
| 	drawtype = "torchlike", | ||||
| 	tiles = {"farming_coffee_cup.png"}, | ||||
| 	inventory_image = "farming_coffee_cup.png", | ||||
| @@ -25,12 +25,14 @@ minetest.register_node("farming:coffee_cup", { | ||||
| 		type = "fixed", | ||||
| 		fixed = {-0.25, -0.5, -0.25, 0.25, 0.25, 0.25} | ||||
| 	}, | ||||
| 	groups = {vessel = 1, dig_immediate = 3, attached_node = 1, drink = 1, eatable = 2}, | ||||
| 	groups = {vessel = 1, dig_immediate = 3, attached_node = 1, drink = 1}, | ||||
| 	is_ground_content = false, | ||||
| 	on_use = minetest.item_eat(2, "vessels:drinking_glass"), | ||||
| 	sounds = farming.sounds.node_sound_glass_defaults() | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:coffee_cup", 2) | ||||
|  | ||||
| minetest.register_alias("farming:coffee_cup_hot", "farming:coffee_cup") | ||||
| minetest.register_alias("farming:drinking_cup", "vessels:drinking_glass") | ||||
|  | ||||
|   | ||||
| @@ -9,10 +9,10 @@ local a = farming.recipe_items | ||||
|  | ||||
| -- corn | ||||
| minetest.register_craftitem("farming:corn", { | ||||
| 	description = S("Corn") .. " (♥3)", | ||||
| 	description = S("Corn"), | ||||
| 	inventory_image = "farming_corn.png", | ||||
| 	groups = { | ||||
| 		compostability = 45, seed = 2, food_corn = 1, flammable = 2, eatable = 3 | ||||
| 		compostability = 45, seed = 2, food_corn = 1, flammable = 2 | ||||
| 	}, | ||||
| 	on_place = function(itemstack, placer, pointed_thing) | ||||
| 		return farming.place_seed(itemstack, placer, pointed_thing, "farming:corn_1") | ||||
| @@ -20,14 +20,18 @@ minetest.register_craftitem("farming:corn", { | ||||
| 	on_use = minetest.item_eat(3) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:corn", 3) | ||||
|  | ||||
| -- corn on the cob (texture by TenPlus1) | ||||
| minetest.register_craftitem("farming:corn_cob", { | ||||
| 	description = S("Corn on the Cob") .. " (♥5)", | ||||
| 	description = S("Corn on the Cob"), | ||||
| 	inventory_image = "farming_corn_cob.png", | ||||
| 	groups = {compostability = 65, food_corn_cooked = 1, flammable = 2, eatable = 5}, | ||||
| 	groups = {compostability = 65, food_corn_cooked = 1, flammable = 2}, | ||||
| 	on_use = minetest.item_eat(5) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:corn_cob", 5) | ||||
|  | ||||
| minetest.register_craft({ | ||||
| 	type = "cooking", | ||||
| 	cooktime = 10, | ||||
| @@ -37,12 +41,14 @@ minetest.register_craft({ | ||||
|  | ||||
| -- popcorn | ||||
| minetest.register_craftitem("farming:popcorn", { | ||||
| 	description = S("Popcorn") .. " (♥4)", | ||||
| 	description = S("Popcorn"), | ||||
| 	inventory_image = "farming_popcorn.png", | ||||
| 	groups = {compostability = 55, food_popcorn = 1, flammable = 2, eatable = 4}, | ||||
| 	groups = {compostability = 55, food_popcorn = 1, flammable = 2}, | ||||
| 	on_use = minetest.item_eat(4) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:popcorn", 4) | ||||
|  | ||||
| minetest.register_craft({ | ||||
| 	output = "farming:popcorn", | ||||
| 	recipe = { | ||||
|   | ||||
| @@ -8,10 +8,10 @@ local S = farming.translate | ||||
|  | ||||
| -- cucumber | ||||
| minetest.register_craftitem("farming:cucumber", { | ||||
| 	description = S("Cucumber") .. " (♥4)", | ||||
| 	description = S("Cucumber"), | ||||
| 	inventory_image = "farming_cucumber.png", | ||||
| 	groups = { | ||||
| 		compostability = 48, seed = 2, food_cucumber = 1, flammable = 2, eatable = 4 | ||||
| 		compostability = 48, seed = 2, food_cucumber = 1, flammable = 2 | ||||
| 	}, | ||||
| 	on_place = function(itemstack, placer, pointed_thing) | ||||
| 		return farming.place_seed(itemstack, placer, pointed_thing, "farming:cucumber_1") | ||||
| @@ -19,6 +19,8 @@ minetest.register_craftitem("farming:cucumber", { | ||||
| 	on_use = minetest.item_eat(4) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:cucumber", 4) | ||||
|  | ||||
| -- cucumber definition | ||||
| local def = { | ||||
| 	drawtype = "plantlike", | ||||
|   | ||||
| @@ -3,10 +3,10 @@ local S = farming.translate | ||||
|  | ||||
| -- eggplant | ||||
| minetest.register_craftitem("farming:eggplant", { | ||||
| 	description = S("Eggplant") .. " (♥3)", | ||||
| 	description = S("Eggplant"), | ||||
| 	inventory_image = "farming_eggplant.png", | ||||
| 	groups = { | ||||
| 		compostability = 48, seed = 2, food_eggplant = 1, flammable = 2, eatable = 3 | ||||
| 		compostability = 48, seed = 2, food_eggplant = 1, flammable = 2 | ||||
| 	}, | ||||
| 	on_place = function(itemstack, placer, pointed_thing) | ||||
| 		return farming.place_seed(itemstack, placer, pointed_thing, "farming:eggplant_1") | ||||
| @@ -14,6 +14,8 @@ minetest.register_craftitem("farming:eggplant", { | ||||
| 	on_use = minetest.item_eat(3) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:eggplant", 3) | ||||
|  | ||||
| -- definition | ||||
| local def = { | ||||
| 	drawtype = "plantlike", | ||||
|   | ||||
| @@ -13,12 +13,14 @@ minetest.register_craftitem("farming:garlic_clove", { | ||||
|  | ||||
| -- garlic bulb | ||||
| minetest.register_craftitem("farming:garlic", { | ||||
| 	description = S("Garlic") .. " (♥1)", | ||||
| 	description = S("Garlic"), | ||||
| 	inventory_image = "crops_garlic.png", | ||||
| 	on_use = minetest.item_eat(1), | ||||
| 	groups = {food_garlic = 1, flammable = 3, compostability = 55, eatable = 1} | ||||
| 	groups = {food_garlic = 1, flammable = 3, compostability = 55} | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:garlic", 1) | ||||
|  | ||||
| minetest.register_craft({ | ||||
| 	output = "farming:garlic_clove 8", | ||||
| 	recipe = {{"farming:garlic"}} | ||||
|   | ||||
| @@ -3,10 +3,10 @@ local S = farming.translate | ||||
|  | ||||
| -- ginger | ||||
| minetest.register_craftitem("farming:ginger", { | ||||
| 	description = S("Ginger") .. " (♥1)", | ||||
| 	description = S("Ginger"), | ||||
| 	inventory_image = "farming_ginger.png", | ||||
| 	groups = { | ||||
| 		compostability = 48, seed = 2, food_ginger = 1, flammable = 2, eatable = 1 | ||||
| 		compostability = 48, seed = 2, food_ginger = 1, flammable = 2 | ||||
| 	}, | ||||
| 	on_place = function(itemstack, placer, pointed_thing) | ||||
| 		return farming.place_seed(itemstack, placer, pointed_thing, "farming:ginger_1") | ||||
| @@ -14,6 +14,8 @@ minetest.register_craftitem("farming:ginger", { | ||||
| 	on_use = minetest.item_eat(1) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:ginger", 1) | ||||
|  | ||||
| -- ginger definition | ||||
| local def = { | ||||
| 	drawtype = "plantlike", | ||||
|   | ||||
| @@ -65,17 +65,19 @@ end | ||||
|  | ||||
| -- grapes | ||||
| minetest.register_craftitem("farming:grapes", { | ||||
| 	description = S("Grapes") .. " (♥2)", | ||||
| 	description = S("Grapes"), | ||||
| 	inventory_image = "farming_grapes.png", | ||||
| 	on_use = minetest.item_eat(2), | ||||
| 	groups = { | ||||
| 		compostability = 48, seed = 2, food_grapes = 1, flammable = 3, eatable = 2 | ||||
| 		compostability = 48, seed = 2, food_grapes = 1, flammable = 3 | ||||
| 	}, | ||||
| 	on_place = function(itemstack, placer, pointed_thing) | ||||
| 		return place_grapes(itemstack, placer, pointed_thing, "farming:grapes_1") | ||||
| 	end | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:grapes", 2) | ||||
|  | ||||
| -- grapes can be used for violet dye | ||||
| minetest.register_craft({ | ||||
| 	output = a.dye_violet, | ||||
|   | ||||
| @@ -3,10 +3,10 @@ local S = farming.translate | ||||
|  | ||||
| -- lettuce | ||||
| minetest.register_craftitem("farming:lettuce", { | ||||
| 	description = S("Lettuce") .. " (♥2)", | ||||
| 	description = S("Lettuce"), | ||||
| 	inventory_image = "farming_lettuce.png", | ||||
| 	groups = { | ||||
| 		compostability = 48, seed = 2, food_lettuce = 1, flammable = 2, eatable = 2 | ||||
| 		compostability = 48, seed = 2, food_lettuce = 1, flammable = 2 | ||||
| 	}, | ||||
| 	on_place = function(itemstack, placer, pointed_thing) | ||||
| 		return farming.place_seed(itemstack, placer, pointed_thing, "farming:lettuce_1") | ||||
| @@ -14,6 +14,8 @@ minetest.register_craftitem("farming:lettuce", { | ||||
| 	on_use = minetest.item_eat(2) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:lettuce", 2) | ||||
|  | ||||
| local def = { | ||||
| 	drawtype = "plantlike", | ||||
| 	tiles = {"farming_lettuce_1.png"}, | ||||
|   | ||||
| @@ -4,10 +4,10 @@ local a = farming.recipe_items | ||||
|  | ||||
| -- melon | ||||
| minetest.register_craftitem("farming:melon_slice", { | ||||
| 	description = S("Melon Slice") .. " (♥2)", | ||||
| 	description = S("Melon Slice"), | ||||
| 	inventory_image = "farming_melon_slice.png", | ||||
| 	groups = { | ||||
| 		compostability = 48, seed = 2, food_melon_slice = 1, flammable = 3, eatable = 2 | ||||
| 		compostability = 48, seed = 2, food_melon_slice = 1, flammable = 3 | ||||
| 	}, | ||||
| 	on_place = function(itemstack, placer, pointed_thing) | ||||
| 		return farming.place_seed(itemstack, placer, pointed_thing, "farming:melon_1") | ||||
| @@ -15,6 +15,8 @@ minetest.register_craftitem("farming:melon_slice", { | ||||
| 	on_use = minetest.item_eat(2) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:melon_slice", 2) | ||||
|  | ||||
| minetest.register_craft({ | ||||
| 	output = "farming:melon_8", | ||||
| 	recipe = { | ||||
|   | ||||
| @@ -38,12 +38,14 @@ minetest.register_craftitem("farming:mint_leaf", { | ||||
|  | ||||
| -- mint tea | ||||
| minetest.register_craftitem("farming:mint_tea", { | ||||
| 	description = S("Mint Tea") .. " (♥2)", | ||||
| 	description = S("Mint Tea"), | ||||
| 	inventory_image = "farming_mint_tea.png", | ||||
| 	on_use = minetest.item_eat(2, a.drinking_glass), | ||||
| 	groups = {flammable = 4, eatable = 2} | ||||
| 	groups = {flammable = 4} | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:mint_tea", 2) | ||||
|  | ||||
| minetest.register_craft({ | ||||
| 	output = "farming:mint_tea", | ||||
| 	recipe = { | ||||
|   | ||||
| @@ -10,10 +10,10 @@ local a = farming.recipe_items | ||||
|  | ||||
| -- onion | ||||
| minetest.register_craftitem("farming:onion", { | ||||
| 	description = S("Onion") .. " (♥1)", | ||||
| 	description = S("Onion"), | ||||
| 	inventory_image = "crops_onion.png", | ||||
| 	groups = { | ||||
| 		compostability = 48, seed = 2, food_onion = 1, flammable = 3, eatable = 1 | ||||
| 		compostability = 48, seed = 2, food_onion = 1, flammable = 3 | ||||
| 	}, | ||||
| 	on_place = function(itemstack, placer, pointed_thing) | ||||
| 		return farming.place_seed(itemstack, placer, pointed_thing, "farming:onion_1") | ||||
| @@ -21,14 +21,18 @@ minetest.register_craftitem("farming:onion", { | ||||
| 	on_use = minetest.item_eat(1) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:onion", 1) | ||||
|  | ||||
| -- onion soup | ||||
| minetest.register_craftitem("farming:onion_soup", { | ||||
| 	description = S("Onion Soup") .. " (♥6)", | ||||
| 	description = S("Onion Soup"), | ||||
| 	inventory_image = "farming_onion_soup.png", | ||||
| 	groups = {flammable = 2, compostability = 65, eatable = 6}, | ||||
| 	groups = {flammable = 2, compostability = 65}, | ||||
| 	on_use = minetest.item_eat(6, a.bowl) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:onion_soup", 6) | ||||
|  | ||||
| minetest.register_craft({ | ||||
| 	output = "farming:onion_soup", | ||||
| 	recipe = { | ||||
|   | ||||
| @@ -3,10 +3,10 @@ local S = farming.translate | ||||
|  | ||||
| -- item definition | ||||
| minetest.register_craftitem("farming:parsley", { | ||||
| 	description = S("Parsley") .. " (♥1)", | ||||
| 	description = S("Parsley"), | ||||
| 	inventory_image = "farming_parsley.png", | ||||
| 	groups = { | ||||
| 		compostability = 48, seed = 2, food_parsley = 1, flammable = 2, eatable = 1 | ||||
| 		compostability = 48, seed = 2, food_parsley = 1, flammable = 2 | ||||
| 	}, | ||||
| 	on_place = function(itemstack, placer, pointed_thing) | ||||
| 		return farming.place_seed(itemstack, placer, pointed_thing, "farming:parsley_1") | ||||
| @@ -14,6 +14,8 @@ minetest.register_craftitem("farming:parsley", { | ||||
| 	on_use = minetest.item_eat(1) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:parsley", 1) | ||||
|  | ||||
| -- crop definition | ||||
| local def = { | ||||
| 	drawtype = "plantlike", | ||||
|   | ||||
| @@ -6,11 +6,10 @@ local a = farming.recipe_items | ||||
|  | ||||
| -- pea pod | ||||
| minetest.register_craftitem("farming:pea_pod", { | ||||
| 	description = S("Pea Pod") .. " (♥1)", | ||||
| 	description = S("Pea Pod"), | ||||
| 	inventory_image = "farming_pea_pod.png", | ||||
| 	groups = { | ||||
| 		compostability = 48, seed = 2, food_peas = 1, food_pea_pod = 1, flammable = 2, | ||||
| 		eatable = 1 | ||||
| 		compostability = 48, seed = 2, food_peas = 1, food_pea_pod = 1, flammable = 2 | ||||
| 	}, | ||||
| 	on_place = function(itemstack, placer, pointed_thing) | ||||
| 		return farming.place_seed(itemstack, placer, pointed_thing, "farming:pea_1") | ||||
| @@ -18,17 +17,21 @@ minetest.register_craftitem("farming:pea_pod", { | ||||
| 	on_use = minetest.item_eat(1) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:pea_pod", 1) | ||||
|  | ||||
| -- replacement for separate peas item that was removed | ||||
| minetest.register_alias("farming:peas", "farming:pea_pod") | ||||
|  | ||||
| -- pea soup | ||||
| minetest.register_craftitem("farming:pea_soup", { | ||||
| 	description = S("Pea Soup") .. " (♥4)", | ||||
| 	description = S("Pea Soup"), | ||||
| 	inventory_image = "farming_pea_soup.png", | ||||
| 	groups = {flammable = 2, compostability = 65, eatable = 4}, | ||||
| 	groups = {flammable = 2, compostability = 65}, | ||||
| 	on_use = minetest.item_eat(4, a.bowl) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:pea_soup", 4) | ||||
|  | ||||
| minetest.register_craft({ | ||||
| 	output = "farming:pea_soup", | ||||
| 	recipe = { | ||||
|   | ||||
| @@ -20,28 +20,34 @@ minetest.register_craftitem("farming:peppercorn", { | ||||
|  | ||||
| -- green pepper | ||||
| minetest.register_craftitem("farming:pepper", { | ||||
| 	description = S("Green Pepper") .. " (♥2)", | ||||
| 	description = S("Green Pepper"), | ||||
| 	inventory_image = "crops_pepper.png", | ||||
| 	on_use = minetest.item_eat(2), | ||||
| 	groups = {food_pepper = 1, flammable = 3, compostability = 55, eatable = 2} | ||||
| 	groups = {food_pepper = 1, flammable = 3, compostability = 55} | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:pepper", 2) | ||||
|  | ||||
| -- yellow pepper | ||||
| minetest.register_craftitem("farming:pepper_yellow", { | ||||
| 	description = S("Yellow Pepper") .. " (♥3)", | ||||
| 	description = S("Yellow Pepper"), | ||||
| 	inventory_image = "crops_pepper_yellow.png", | ||||
| 	on_use = minetest.item_eat(3), | ||||
| 	groups = {food_pepper = 1, flammable = 3, compostability = 55, eatable = 3} | ||||
| 	groups = {food_pepper = 1, flammable = 3, compostability = 55} | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:pepper_yellow", 3) | ||||
|  | ||||
| -- red pepper | ||||
| minetest.register_craftitem("farming:pepper_red", { | ||||
| 	description = S("Red Pepper") .. " (♥3)", | ||||
| 	description = S("Red Pepper"), | ||||
| 	inventory_image = "crops_pepper_red.png", | ||||
| 	on_use = minetest.item_eat(4), | ||||
| 	groups = {food_pepper = 1, flammable = 3, compostability = 55, eatable = 3} | ||||
| 	groups = {food_pepper = 1, flammable = 3, compostability = 55} | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:pepper_red", 3) | ||||
|  | ||||
| minetest.register_craft({ | ||||
| 	output = "farming:peppercorn", | ||||
| 	recipe = {{"group:food_pepper"}} | ||||
|   | ||||
| @@ -36,12 +36,14 @@ minetest.register_node("farming:pineapple", { | ||||
|  | ||||
| -- pineapple | ||||
| minetest.register_craftitem("farming:pineapple_ring", { | ||||
| 	description = S("Pineapple Ring") .. " (♥1)", | ||||
| 	description = S("Pineapple Ring"), | ||||
| 	inventory_image = "farming_pineapple_ring.png", | ||||
| 	groups = {food_pineapple_ring = 1, flammable = 2, compostability = 45, eatable = 1}, | ||||
| 	groups = {food_pineapple_ring = 1, flammable = 2, compostability = 45}, | ||||
| 	on_use = minetest.item_eat(1) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:pineapple_ring", 1) | ||||
|  | ||||
| minetest.register_craft( { | ||||
| 	output = "farming:pineapple_ring 5", | ||||
| 	recipe = {{"group:food_pineapple"}}, | ||||
| @@ -50,12 +52,14 @@ minetest.register_craft( { | ||||
|  | ||||
| -- pineapple juice | ||||
| minetest.register_craftitem("farming:pineapple_juice", { | ||||
| 	description = S("Pineapple Juice") .. " (♥4)", | ||||
| 	description = S("Pineapple Juice"), | ||||
| 	inventory_image = "farming_pineapple_juice.png", | ||||
| 	on_use = minetest.item_eat(4, "vessels:drinking_glass"), | ||||
| 	groups = {vessel = 1, drink = 1, compostability = 35, eatable = 4} | ||||
| 	groups = {vessel = 1, drink = 1, compostability = 35} | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:pineapple_juice", 4) | ||||
|  | ||||
| minetest.register_craft({ | ||||
| 	output = "farming:pineapple_juice", | ||||
| 	recipe = { | ||||
|   | ||||
| @@ -8,9 +8,9 @@ local S = farming.translate | ||||
|  | ||||
| -- potato | ||||
| minetest.register_craftitem("farming:potato", { | ||||
| 	description = S("Potato") .. " (♥1)", | ||||
| 	description = S("Potato"), | ||||
| 	inventory_image = "farming_potato.png", | ||||
| 	groups = {compostability = 48, seed = 2, food_potato = 1, flammable = 2, eatable = 1}, | ||||
| 	groups = {compostability = 48, seed = 2, food_potato = 1, flammable = 2}, | ||||
| 	on_place = function(itemstack, placer, pointed_thing) | ||||
| 		return farming.place_seed(itemstack, placer, pointed_thing, "farming:potato_1") | ||||
| 	end, | ||||
| @@ -26,14 +26,18 @@ minetest.register_craftitem("farming:potato", { | ||||
| 	end | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:potato", 1) | ||||
|  | ||||
| -- baked potato | ||||
| minetest.register_craftitem("farming:baked_potato", { | ||||
| 	description = S("Baked Potato") .. " (♥6)", | ||||
| 	description = S("Baked Potato"), | ||||
| 	inventory_image = "farming_baked_potato.png", | ||||
| 	on_use = minetest.item_eat(6), | ||||
| 	groups = {eatable = 6} | ||||
| 	groups = {flammable = 2} | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:baked_potato", 6) | ||||
|  | ||||
| minetest.register_craft({ | ||||
| 	type = "cooking", | ||||
| 	cooktime = 10, | ||||
| @@ -43,12 +47,14 @@ minetest.register_craft({ | ||||
|  | ||||
| -- Potato and cucumber Salad | ||||
| minetest.register_craftitem("farming:potato_salad", { | ||||
| 	description = S("Cucumber and Potato Salad") .. " (♥10)", | ||||
| 	description = S("Cucumber and Potato Salad"), | ||||
| 	inventory_image = "farming_potato_salad.png", | ||||
| 	on_use = minetest.item_eat(10, "farming:bowl"), | ||||
| 	groups = {eatable = 10} | ||||
| 	groups = {flammable = 2} | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:potato_salad", 10) | ||||
|  | ||||
| minetest.register_craft({ | ||||
| 	output = "farming:potato_salad", | ||||
| 	recipe = { | ||||
|   | ||||
| @@ -3,10 +3,10 @@ local S = farming.translate | ||||
|  | ||||
| -- pumpkin slice | ||||
| minetest.register_craftitem("farming:pumpkin_slice", { | ||||
| 	description = S("Pumpkin Slice") .. " (♥2)", | ||||
| 	description = S("Pumpkin Slice"), | ||||
| 	inventory_image = "farming_pumpkin_slice.png", | ||||
| 	groups = { | ||||
| 		compostability = 48, seed = 2, food_pumpkin_slice = 1, flammable = 2, eatable = 2 | ||||
| 		compostability = 48, seed = 2, food_pumpkin_slice = 1, flammable = 2 | ||||
| 	}, | ||||
| 	on_place = function(itemstack, placer, pointed_thing) | ||||
| 		return farming.place_seed(itemstack, placer, pointed_thing, "farming:pumpkin_1") | ||||
| @@ -14,6 +14,8 @@ minetest.register_craftitem("farming:pumpkin_slice", { | ||||
| 	on_use = minetest.item_eat(2) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:pumpkin_slice", 2) | ||||
|  | ||||
| minetest.register_craft({ | ||||
| 	output = "farming:pumpkin", | ||||
| 	recipe = { | ||||
| @@ -125,12 +127,14 @@ minetest.register_craft({ | ||||
|  | ||||
| -- pumpkin bread | ||||
| minetest.register_craftitem("farming:pumpkin_bread", { | ||||
| 	description = S("Pumpkin Bread") .. " (♥8)", | ||||
| 	description = S("Pumpkin Bread"), | ||||
| 	inventory_image = "farming_pumpkin_bread.png", | ||||
| 	on_use = minetest.item_eat(8), | ||||
| 	groups = {food_bread = 1, flammable = 2, eatable = 8} | ||||
| 	groups = {food_bread = 1, flammable = 2} | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:pumpkin_bread", 8) | ||||
|  | ||||
| minetest.register_craftitem("farming:pumpkin_dough", { | ||||
| 	description = S("Pumpkin Dough"), | ||||
| 	inventory_image = "farming_pumpkin_dough.png" | ||||
|   | ||||
| @@ -4,11 +4,11 @@ local a = farming.recipe_items | ||||
|  | ||||
| -- raspberries | ||||
| minetest.register_craftitem("farming:raspberries", { | ||||
| 	description = S("Raspberries") .. " (♥1)", | ||||
| 	description = S("Raspberries"), | ||||
| 	inventory_image = "farming_raspberries.png", | ||||
| 	groups = { | ||||
| 		compostability = 48, seed = 2, food_raspberries = 1, food_raspberry = 1, | ||||
| 		food_berry = 1, flammable = 2, eatable = 1 | ||||
| 		food_berry = 1, flammable = 2 | ||||
| 	}, | ||||
| 	on_place = function(itemstack, placer, pointed_thing) | ||||
| 		return farming.place_seed(itemstack, placer, pointed_thing, "farming:raspberry_1") | ||||
| @@ -16,14 +16,18 @@ minetest.register_craftitem("farming:raspberries", { | ||||
| 	on_use = minetest.item_eat(1) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:raspberries", 1) | ||||
|  | ||||
| -- raspberry smoothie | ||||
| minetest.register_craftitem("farming:smoothie_raspberry", { | ||||
| 	description = S("Raspberry Smoothie") .. " (♥2)", | ||||
| 	description = S("Raspberry Smoothie"), | ||||
| 	inventory_image = "farming_raspberry_smoothie.png", | ||||
| 	on_use = minetest.item_eat(2, "vessels:drinking_glass"), | ||||
| 	groups = {vessel = 1, drink = 1, compostability = 65, eatable = 2} | ||||
| 	groups = {vessel = 1, drink = 1, compostability = 65} | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:smoothie_raspberry", 2) | ||||
|  | ||||
| minetest.register_craft({ | ||||
| 	output = "farming:smoothie_raspberry", | ||||
| 	recipe = { | ||||
|   | ||||
| @@ -4,10 +4,10 @@ local a = farming.recipe_items | ||||
|  | ||||
| -- rhubarb | ||||
| minetest.register_craftitem("farming:rhubarb", { | ||||
| 	description = S("Rhubarb") .. " (♥1)", | ||||
| 	description = S("Rhubarb"), | ||||
| 	inventory_image = "farming_rhubarb.png", | ||||
| 	groups = { | ||||
| 		compostability = 48, seed = 2, food_rhubarb = 1, flammable = 2, eatable = 1 | ||||
| 		compostability = 48, seed = 2, food_rhubarb = 1, flammable = 2 | ||||
| 	}, | ||||
| 	on_place = function(itemstack, placer, pointed_thing) | ||||
| 		return farming.place_seed(itemstack, placer, pointed_thing, "farming:rhubarb_1") | ||||
| @@ -15,14 +15,18 @@ minetest.register_craftitem("farming:rhubarb", { | ||||
| 	on_use = minetest.item_eat(1) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:rhubarb", 1) | ||||
|  | ||||
| -- rhubarb pie | ||||
| minetest.register_craftitem("farming:rhubarb_pie", { | ||||
| 	description = S("Rhubarb Pie") .. " (♥6)", | ||||
| 	description = S("Rhubarb Pie"), | ||||
| 	inventory_image = "farming_rhubarb_pie.png", | ||||
| 	on_use = minetest.item_eat(6), | ||||
| 	groups = {compostability = 65, eatable = 6} | ||||
| 	groups = {compostability = 65, flammable = 2} | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:rhubarb_pie", 6) | ||||
|  | ||||
| minetest.register_craft({ | ||||
| 	output = "farming:rhubarb_pie", | ||||
| 	recipe = { | ||||
|   | ||||
| @@ -46,12 +46,14 @@ minetest.register_craft({ | ||||
|  | ||||
| -- rice flour and bread | ||||
| minetest.register_craftitem("farming:rice_bread", { | ||||
| 	description = S("Rice Bread") .. " (♥5)", | ||||
| 	description = S("Rice Bread"), | ||||
| 	inventory_image = "farming_rice_bread.png", | ||||
| 	on_use = minetest.item_eat(5), | ||||
| 	groups = {food_rice_bread = 1, flammable = 2, compostability = 65, eatable = 5} | ||||
| 	groups = {food_rice_bread = 1, flammable = 2, compostability = 65} | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:rice_bread", 5) | ||||
|  | ||||
| minetest.register_craftitem("farming:rice_flour", { | ||||
| 	description = S("Rice Flour"), | ||||
| 	inventory_image = "farming_rice_flour.png", | ||||
|   | ||||
| @@ -81,12 +81,14 @@ minetest.register_craft({ | ||||
| -- Multigrain bread | ||||
|  | ||||
| minetest.register_craftitem("farming:bread_multigrain", { | ||||
| 	description = S("Multigrain Bread") .. " (♥7)", | ||||
| 	description = S("Multigrain Bread"), | ||||
| 	inventory_image = "farming_bread_multigrain.png", | ||||
| 	on_use = minetest.item_eat(7), | ||||
| 	groups = {food_bread = 1, flammable = 2, compostability = 65, eatable = 7} | ||||
| 	groups = {food_bread = 1, flammable = 2, compostability = 65} | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:bread_multigrain", 7) | ||||
|  | ||||
| minetest.register_craft({ | ||||
| 	type = "cooking", | ||||
| 	cooktime = 15, | ||||
|   | ||||
| @@ -51,7 +51,7 @@ minetest.register_craft( { | ||||
|  | ||||
| -- soy milk | ||||
| minetest.register_node("farming:soy_milk", { | ||||
| 	description = S("Soy Milk") .. " (♥2)", | ||||
| 	description = S("Soy Milk"), | ||||
| 	drawtype = "plantlike", | ||||
| 	tiles = {"farming_soy_milk_glass.png"}, | ||||
| 	inventory_image = "farming_soy_milk_glass.png", | ||||
| @@ -64,13 +64,15 @@ minetest.register_node("farming:soy_milk", { | ||||
| 	}, | ||||
| 	on_use = minetest.item_eat(2, "vessels:drinking_glass"), | ||||
| 	groups = { | ||||
| 		vessel = 1, food_milk_glass = 1, dig_immediate = 3, eatable = 2, | ||||
| 		vessel = 1, food_milk_glass = 1, dig_immediate = 3, | ||||
| 		attached_node = 1, drink = 1, compostability = 65 | ||||
| 	}, | ||||
| 	is_ground_content = false, | ||||
| 	sounds = farming.sounds.node_sound_glass_defaults() | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:soy_milk", 2) | ||||
|  | ||||
| minetest.register_craft( { | ||||
| 	output = "farming:soy_milk", | ||||
| 	recipe = { | ||||
| @@ -85,14 +87,16 @@ minetest.register_craft( { | ||||
|  | ||||
| -- tofu | ||||
| minetest.register_craftitem("farming:tofu", { | ||||
| 	description = S("Tofu") .. " (♥3)", | ||||
| 	description = S("Tofu"), | ||||
| 	inventory_image = "farming_tofu.png", | ||||
| 	groups = { | ||||
| 		food_tofu = 1, food_meat_raw = 1, flammable = 2, compostability = 65, eatable = 3 | ||||
| 		food_tofu = 1, food_meat_raw = 1, flammable = 2, compostability = 65, | ||||
| 	}, | ||||
| 	on_use = minetest.item_eat(3) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:tofu", 3) | ||||
|  | ||||
| minetest.register_craft({ | ||||
| 	output = "farming:tofu", | ||||
| 	recipe = { | ||||
| @@ -104,12 +108,14 @@ minetest.register_craft({ | ||||
|  | ||||
| -- cooked tofu | ||||
| minetest.register_craftitem("farming:tofu_cooked", { | ||||
| 	description = S("Cooked Tofu") .. " (♥6)", | ||||
| 	description = S("Cooked Tofu"), | ||||
| 	inventory_image = "farming_tofu_cooked.png", | ||||
| 	groups = {food_meat = 1, flammable = 2, compostability = 65, eatable = 6}, | ||||
| 	groups = {food_meat = 1, flammable = 2, compostability = 65}, | ||||
| 	on_use = minetest.item_eat(6) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:tofu_cooked", 6) | ||||
|  | ||||
| minetest.register_craft({ | ||||
| 	type = "cooking", | ||||
| 	output = "farming:tofu_cooked", | ||||
|   | ||||
| @@ -3,10 +3,10 @@ local S = farming.translate | ||||
|  | ||||
| -- spinach | ||||
| minetest.register_craftitem("farming:spinach", { | ||||
| 	description = S("Spinach") .. " (♥1)", | ||||
| 	description = S("Spinach"), | ||||
| 	inventory_image = "farming_spinach.png", | ||||
| 	groups = { | ||||
| 		compostability = 48, seed = 2, food_spinach = 1, flammable = 2, eatable = 1 | ||||
| 		compostability = 48, seed = 2, food_spinach = 1, flammable = 2 | ||||
| 	}, | ||||
| 	on_place = function(itemstack, placer, pointed_thing) | ||||
| 		return farming.place_seed(itemstack, placer, pointed_thing, "farming:spinach_1") | ||||
| @@ -14,6 +14,8 @@ minetest.register_craftitem("farming:spinach", { | ||||
| 	on_use = minetest.item_eat(1) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:spinach", 1) | ||||
|  | ||||
| -- definition | ||||
| local def = { | ||||
| 	drawtype = "plantlike", | ||||
|   | ||||
| @@ -3,11 +3,10 @@ local S = farming.translate | ||||
|  | ||||
| -- Strawberry (can also be planted as seed) | ||||
| minetest.register_craftitem(":ethereal:strawberry", { | ||||
| 	description = S("Strawberry") .. " (♥1)", | ||||
| 	description = S("Strawberry"), | ||||
| 	inventory_image = "ethereal_strawberry.png", | ||||
| 	groups = { | ||||
| 		compostability = 48, seed = 2, food_strawberry = 1, food_berry = 1, | ||||
| 		flammable = 2, eatable = 1 | ||||
| 		compostability = 48, seed = 2, food_strawberry = 1, food_berry = 1, flammable = 2 | ||||
| 	}, | ||||
| 	on_place = function(itemstack, placer, pointed_thing) | ||||
| 		return farming.place_seed(itemstack, placer, pointed_thing, "ethereal:strawberry_1") | ||||
| @@ -15,6 +14,8 @@ minetest.register_craftitem(":ethereal:strawberry", { | ||||
| 	on_use = minetest.item_eat(1) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("ethereal:strawberry", 1) | ||||
|  | ||||
| -- Define Strawberry Bush growth stages | ||||
| local def = { | ||||
| 	drawtype = "plantlike", | ||||
|   | ||||
| @@ -45,14 +45,16 @@ minetest.register_craft({ | ||||
|  | ||||
| -- sunflower seeds (toasted) | ||||
| minetest.register_craftitem("farming:sunflower_seeds_toasted", { | ||||
| 	description = S("Toasted Sunflower Seeds") .. " (♥1)", | ||||
| 	description = S("Toasted Sunflower Seeds"), | ||||
| 	inventory_image = "farming_sunflower_seeds_toasted.png", | ||||
| 	groups = { | ||||
| 		food_sunflower_seeds_toasted = 1, flammable = 2, compostability = 65, eatable = 1 | ||||
| 		food_sunflower_seeds_toasted = 1, flammable = 2, compostability = 65 | ||||
| 	}, | ||||
| 	on_use = minetest.item_eat(1) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:sunflower_seeds_toasted", 1) | ||||
|  | ||||
| minetest.register_craft({ | ||||
| 	type = "cooking", | ||||
| 	cooktime = 10, | ||||
| @@ -99,12 +101,14 @@ minetest.register_craft({ | ||||
|  | ||||
| -- sunflower seed bread | ||||
| minetest.register_craftitem("farming:sunflower_bread", { | ||||
| 	description = S("Sunflower Seed Bread") .. " (♥8)", | ||||
| 	description = S("Sunflower Seed Bread"), | ||||
| 	inventory_image = "farming_sunflower_bread.png", | ||||
| 	on_use = minetest.item_eat(8), | ||||
| 	groups = {food_bread = 1, flammable = 2, eatable = 8} | ||||
| 	groups = {food_bread = 1, flammable = 2} | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:sunflower_bread", 8) | ||||
|  | ||||
| minetest.register_craft({ | ||||
| 	output = "farming:sunflower_bread", | ||||
| 	recipe = { | ||||
|   | ||||
| @@ -8,23 +8,27 @@ local S = farming.translate | ||||
|  | ||||
| -- tomato | ||||
| minetest.register_craftitem("farming:tomato", { | ||||
| 	description = S("Tomato") .. " (♥4)", | ||||
| 	description = S("Tomato"), | ||||
| 	inventory_image = "farming_tomato.png", | ||||
| 	groups = {compostability = 45, seed = 2, food_tomato = 1, flammable = 2, eatable = 4}, | ||||
| 	groups = {compostability = 45, seed = 2, food_tomato = 1, flammable = 2}, | ||||
| 	on_place = function(itemstack, placer, pointed_thing) | ||||
| 		return farming.place_seed(itemstack, placer, pointed_thing, "farming:tomato_1") | ||||
| 	end, | ||||
| 	on_use = minetest.item_eat(4) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:tomato", 4) | ||||
|  | ||||
| -- tomato soup | ||||
| minetest.register_craftitem("farming:tomato_soup", { | ||||
| 	description = S("Tomato Soup") .. " (♥8)", | ||||
| 	description = S("Tomato Soup"), | ||||
| 	inventory_image = "farming_tomato_soup.png", | ||||
| 	groups = {flammable = 2, compostability = 65, eatable = 8}, | ||||
| 	groups = {flammable = 2, compostability = 65}, | ||||
| 	on_use = minetest.item_eat(8, "farming:bowl") | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:tomato_soup", 8) | ||||
|  | ||||
| minetest.register_craft({ | ||||
| 	output = "farming:tomato_soup", | ||||
| 	recipe = { | ||||
|   | ||||
| @@ -4,10 +4,10 @@ local a = farming.recipe_items | ||||
|  | ||||
| -- vanilla | ||||
| minetest.register_craftitem("farming:vanilla", { | ||||
| 	description = S("Vanilla") .. " (♥1)", | ||||
| 	description = S("Vanilla"), | ||||
| 	inventory_image = "farming_vanilla.png", | ||||
| 	groups = { | ||||
| 		compostability = 48, seed = 2, food_vanilla = 1, flammable = 2, eatable = 1 | ||||
| 		compostability = 48, seed = 2, food_vanilla = 1, flammable = 2 | ||||
| 	}, | ||||
| 	on_place = function(itemstack, placer, pointed_thing) | ||||
| 		return farming.place_seed(itemstack, placer, pointed_thing, "farming:vanilla_1") | ||||
| @@ -15,6 +15,8 @@ minetest.register_craftitem("farming:vanilla", { | ||||
| 	on_use = minetest.item_eat(1) | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:vanilla", 1) | ||||
|  | ||||
| -- crop definition | ||||
| local def = { | ||||
| 	drawtype = "plantlike", | ||||
|   | ||||
| @@ -99,12 +99,14 @@ minetest.register_craft({ | ||||
|  | ||||
| -- bread | ||||
| minetest.register_craftitem("farming:bread", { | ||||
| 	description = S("Bread") .. " (♥5)", | ||||
| 	description = S("Bread"), | ||||
| 	inventory_image = "farming_bread.png", | ||||
| 	on_use = minetest.item_eat(5), | ||||
| 	groups = {food_bread = 1, flammable = 2, eatable = 5} | ||||
| 	groups = {food_bread = 1, flammable = 2} | ||||
| }) | ||||
|  | ||||
| farming.add_eatable("farming:bread", 5) | ||||
|  | ||||
| minetest.register_craft({ | ||||
| 	type = "cooking", | ||||
| 	cooktime = 15, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user