Use group instead of explicit item for sugar

Using the group instead of the item allows the pie recipes to remain
valid when various other mods (e.g. 'food' are in use.
This commit is contained in:
Ciaran Gultnieks 2014-03-02 14:53:54 +00:00
parent 652f451360
commit 9eb67b06e7

View File

@ -14,6 +14,7 @@ minetest.register_craftitem(":bushes:sugar", {
description = "Sugar", description = "Sugar",
inventory_image = "bushes_sugar.png", inventory_image = "bushes_sugar.png",
on_use = minetest.item_eat(1), on_use = minetest.item_eat(1),
groups = {food_sugar=1}
}) })
minetest.register_craft({ minetest.register_craft({
@ -44,7 +45,7 @@ for i, berry in ipairs(bushes_classic.bushes) do
minetest.register_craft({ minetest.register_craft({
output = "bushes:"..berry.."_pie_raw 1", output = "bushes:"..berry.."_pie_raw 1",
recipe = { recipe = {
{ "bushes:sugar", "farming:flour", "bushes:sugar" }, { "group:food_sugar", "farming:flour", "group:food_sugar" },
{ "group:"..berry, "group:"..berry, "group:"..berry }, { "group:"..berry, "group:"..berry, "group:"..berry },
}, },
}) })
@ -52,7 +53,7 @@ for i, berry in ipairs(bushes_classic.bushes) do
minetest.register_craft({ minetest.register_craft({
output = "bushes:"..berry.."_pie_raw 1", output = "bushes:"..berry.."_pie_raw 1",
recipe = { recipe = {
{ "bushes:sugar", "group:junglegrass", "bushes:sugar" }, { "group:food_sugar", "group:junglegrass", "group:food_sugar" },
{ "group:"..berry, "group:"..berry, "group:"..berry }, { "group:"..berry, "group:"..berry, "group:"..berry },
}, },
}) })
@ -113,7 +114,7 @@ if minetest.registered_nodes["farming:soil"] then
minetest.register_craft({ minetest.register_craft({
output = "bushes:mixed_berry_pie_raw 2", output = "bushes:mixed_berry_pie_raw 2",
recipe = { recipe = {
{ "bushes:sugar", "farming:flour", "bushes:sugar" }, { "group:food_sugar", "farming:flour", "group:food_sugar" },
{ "group:berry", "group:berry", "group:berry" }, { "group:berry", "group:berry", "group:berry" },
{ "group:berry", "group:berry", "group:berry" }, { "group:berry", "group:berry", "group:berry" },
}, },
@ -122,7 +123,7 @@ else
minetest.register_craft({ minetest.register_craft({
output = "bushes:mixed_berry_pie_raw 2", output = "bushes:mixed_berry_pie_raw 2",
recipe = { recipe = {
{ "bushes:sugar", "group:junglegrass", "bushes:sugar" }, { "group:food_sugar", "group:junglegrass", "group:food_sugar" },
{ "group:berry", "group:berry", "group:berry" }, { "group:berry", "group:berry", "group:berry" },
{ "group:berry", "group:berry", "group:berry" }, { "group:berry", "group:berry", "group:berry" },
}, },