Version 2.4
* Add customizable settings for changing basic ingredients from Minetest settings, * Rework item replacements in some crafting recipes, * Disable some redundant items when farming or mobs mod is loaded, * Improve recent version of farming_redo support, * Some crafting recipes are slightly changed, * Fix warnings at load time. Tested with minetest_game, farming_redo and mobs_animal.
This commit is contained in:
@ -14,201 +14,211 @@ else
|
||||
S = function ( s ) return s end
|
||||
end
|
||||
|
||||
food.module("wheat", function()
|
||||
minetest.register_craftitem(":food:wheat", {
|
||||
description = S("Wheat"),
|
||||
inventory_image = "food_wheat.png",
|
||||
groups = {food_wheat=1}
|
||||
})
|
||||
if food.bing["dry_shrub"] ~= "none" then
|
||||
food.module("wheat", function()
|
||||
minetest.register_craftitem(":food:wheat", {
|
||||
description = S("Wheat"),
|
||||
inventory_image = "food_wheat.png",
|
||||
groups = {food_wheat=1}
|
||||
})
|
||||
food.craft({
|
||||
type = "shapeless",
|
||||
output = "food:wheat",
|
||||
recipe = {food.bing["dry_shrub"]}
|
||||
})
|
||||
end, true)
|
||||
|
||||
food.craft({
|
||||
output = "food:wheat",
|
||||
recipe = {
|
||||
{"default:dry_shrub"},
|
||||
}
|
||||
})
|
||||
end, true)
|
||||
food.module("flour", function()
|
||||
minetest.register_craftitem(":food:flour", {
|
||||
description = S("Flour"),
|
||||
inventory_image = "food_flour.png",
|
||||
groups = {food_flour = 1}
|
||||
})
|
||||
food.craft({
|
||||
output = "food:flour",
|
||||
recipe = {
|
||||
{"group:food_wheat"},
|
||||
{"group:food_wheat"}
|
||||
}
|
||||
})
|
||||
end, true)
|
||||
end
|
||||
|
||||
food.module("flour", function()
|
||||
minetest.register_craftitem(":food:flour", {
|
||||
description = S("Flour"),
|
||||
inventory_image = "food_flour.png",
|
||||
groups = {food_flour = 1}
|
||||
})
|
||||
food.craft({
|
||||
output = "food:flour",
|
||||
recipe = {
|
||||
{"group:food_wheat"},
|
||||
{"group:food_wheat"}
|
||||
}
|
||||
})
|
||||
food.craft({
|
||||
output = "food:flour",
|
||||
recipe = {
|
||||
{"default:sand"},
|
||||
{"default:sand"}
|
||||
}
|
||||
})
|
||||
end, true)
|
||||
if food.bing["dirt"] ~= "none" and food.bing["apple"] ~= "none" then
|
||||
food.module("potato", function()
|
||||
minetest.register_craftitem(":food:potato", {
|
||||
description = S("Potato"),
|
||||
inventory_image = "food_potato.png",
|
||||
groups = {food_potato = 1}
|
||||
})
|
||||
food.craft({
|
||||
output = "food:potato",
|
||||
recipe = {
|
||||
{food.bing["dirt"]},
|
||||
{food.bing["apple"]}
|
||||
}
|
||||
})
|
||||
end, true)
|
||||
|
||||
food.module("potato", function()
|
||||
minetest.register_craftitem(":food:potato", {
|
||||
description = S("Potato"),
|
||||
inventory_image = "food_potato.png",
|
||||
groups = {food_potato = 1}
|
||||
})
|
||||
food.craft({
|
||||
output = "food:potato",
|
||||
recipe = {
|
||||
{"default:dirt"},
|
||||
{"default:apple"}
|
||||
|
||||
}
|
||||
})
|
||||
end, true)
|
||||
|
||||
food.module("orange", function()
|
||||
minetest.register_craftitem(":food:orange", {
|
||||
description = S("Orange"),
|
||||
inventory_image = "food_orange.png",
|
||||
groups = {food_orange = 1}
|
||||
})
|
||||
food.craft({
|
||||
output = "food:orange",
|
||||
recipe = {
|
||||
{"", "default:desert_sand", ""},
|
||||
{"default:desert_sand", "default:desert_sand", "default:desert_sand"},
|
||||
{"", "default:desert_sand", ""}
|
||||
}
|
||||
})
|
||||
end, true)
|
||||
|
||||
food.module("tomato", function()
|
||||
minetest.register_craftitem(":food:tomato", {
|
||||
description = S("Tomato"),
|
||||
inventory_image = "food_tomato.png",
|
||||
groups = {food_tomato = 1}
|
||||
})
|
||||
food.craft({
|
||||
output = "food:tomato",
|
||||
recipe = {
|
||||
{"", "default:desert_sand", ""},
|
||||
{"default:desert_sand", "", "default:desert_sand"},
|
||||
{"", "default:desert_sand", ""}
|
||||
}
|
||||
})
|
||||
end, true)
|
||||
|
||||
food.module("carrot", function()
|
||||
minetest.register_craftitem(":food:carrot", {
|
||||
description = S("Carrot"),
|
||||
inventory_image = "food_carrot.png",
|
||||
groups = {food_carrot=1},
|
||||
on_use = food.item_eat(3)
|
||||
})
|
||||
food.craft({
|
||||
output = "food:carrot",
|
||||
recipe = {
|
||||
{"default:apple", "default:apple", "default:apple"},
|
||||
}
|
||||
})
|
||||
end, true)
|
||||
|
||||
food.module("milk", function()
|
||||
minetest.register_craftitem(":food:milk", {
|
||||
description = S("Milk"),
|
||||
image = "food_milk.png",
|
||||
on_use = food.item_eat(1),
|
||||
groups = { eatable=1, food_milk = 1 },
|
||||
stack_max=10
|
||||
})
|
||||
food.craft({
|
||||
output = "food:milk",
|
||||
recipe = {
|
||||
{"default:sand"},
|
||||
{"bucket:bucket_water"}
|
||||
},
|
||||
replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}},
|
||||
})
|
||||
end, true)
|
||||
|
||||
food.module("egg", function()
|
||||
minetest.register_craftitem(":food:egg", {
|
||||
description = S("Egg"),
|
||||
inventory_image = "food_egg.png",
|
||||
groups = {food_egg=1}
|
||||
})
|
||||
food.craft({
|
||||
output = "food:egg",
|
||||
recipe = {
|
||||
{"", "default:sand", ""},
|
||||
{"default:sand", "", "default:sand"},
|
||||
{"", "default:sand", ""}
|
||||
}
|
||||
})
|
||||
end, true)
|
||||
|
||||
food.module("cocoa", function()
|
||||
minetest.register_craftitem(":food:cocoa", {
|
||||
description = S("Cocoa Bean"),
|
||||
inventory_image = "food_cocoa.png",
|
||||
groups = {food_cocoa=1}
|
||||
})
|
||||
food.craft({
|
||||
output = "food:cocoa",
|
||||
recipe = {
|
||||
{"", "default:apple", ""},
|
||||
{"default:apple", "", "default:apple"},
|
||||
{"", "default:apple", ""}
|
||||
}
|
||||
})
|
||||
end, true)
|
||||
|
||||
food.module("meat", function()
|
||||
minetest.register_craftitem(":food:meat", {
|
||||
description = S("Venison"),
|
||||
inventory_image = "food_meat.png",
|
||||
groups = {food_meat=1, food_chicken=1}
|
||||
})
|
||||
food.craft({
|
||||
type = "cooking",
|
||||
output = "food:meat",
|
||||
recipe = "group:food_meat_raw",
|
||||
cooktime = 30
|
||||
})
|
||||
|
||||
if not minetest.get_modpath("animalmaterials") then
|
||||
food.module("meat_raw", function()
|
||||
minetest.register_craftitem(":food:meat_raw", {
|
||||
description = S("Raw meat"),
|
||||
image = "food_meat_raw.png",
|
||||
on_use = food.item_eat(1),
|
||||
groups = { meat=1, eatable=1, food_meat_raw=1 },
|
||||
groups = { meat=1, eatable=1, food_meat=1, food_meat_raw=1 },
|
||||
stack_max=25
|
||||
})
|
||||
food.craft({
|
||||
output = "food:meat_raw",
|
||||
recipe = {
|
||||
{"default:apple"},
|
||||
{"default:dirt"}
|
||||
{food.bing["apple"]},
|
||||
{food.bing["dirt"]}
|
||||
}
|
||||
})
|
||||
end
|
||||
end, true)
|
||||
end, true)
|
||||
end
|
||||
|
||||
food.module("sugar", function()
|
||||
minetest.register_craftitem(":food:sugar", {
|
||||
description = S("Sugar"),
|
||||
inventory_image = "food_sugar.png",
|
||||
groups = {food_sugar=1}
|
||||
})
|
||||
if food.bing["desert_sand"] ~= "none" then
|
||||
food.module("orange", function()
|
||||
minetest.register_craftitem(":food:orange", {
|
||||
description = S("Orange"),
|
||||
inventory_image = "food_orange.png",
|
||||
groups = {food_orange = 1}
|
||||
})
|
||||
food.craft({
|
||||
output = "food:orange",
|
||||
recipe = {
|
||||
{"", food.bing["desert_sand"], ""},
|
||||
{food.bing["desert_sand"], food.bing["desert_sand"], food.bing["desert_sand"]},
|
||||
{"", food.bing["desert_sand"], ""}
|
||||
}
|
||||
})
|
||||
end, true)
|
||||
|
||||
minetest.register_craft({
|
||||
output = "food:sugar 20",
|
||||
recipe = {
|
||||
{"default:papyrus"},
|
||||
}
|
||||
})
|
||||
end, true)
|
||||
food.module("tomato", function()
|
||||
minetest.register_craftitem(":food:tomato", {
|
||||
description = S("Tomato"),
|
||||
inventory_image = "food_tomato.png",
|
||||
groups = {food_tomato = 1}
|
||||
})
|
||||
food.craft({
|
||||
output = "food:tomato",
|
||||
recipe = {
|
||||
{"", food.bing["desert_sand"], ""},
|
||||
{food.bing["desert_sand"], "", food.bing["desert_sand"]},
|
||||
{"", food.bing["desert_sand"], ""}
|
||||
}
|
||||
})
|
||||
end, true)
|
||||
end
|
||||
|
||||
if food.bing["apple"] ~= "none" then
|
||||
food.module("carrot", function()
|
||||
minetest.register_craftitem(":food:carrot", {
|
||||
description = S("Carrot"),
|
||||
inventory_image = "food_carrot.png",
|
||||
groups = {food_carrot=1},
|
||||
on_use = food.item_eat(3)
|
||||
})
|
||||
food.craft({
|
||||
output = "food:carrot",
|
||||
recipe = {
|
||||
{food.bing["apple"], food.bing["apple"], food.bing["apple"]},
|
||||
}
|
||||
})
|
||||
end, true)
|
||||
|
||||
food.module("cocoa", function()
|
||||
minetest.register_craftitem(":food:cocoa", {
|
||||
description = S("Cocoa Bean"),
|
||||
inventory_image = "food_cocoa.png",
|
||||
groups = {food_cocoa=1}
|
||||
})
|
||||
food.craft({
|
||||
output = "food:cocoa",
|
||||
recipe = {
|
||||
{"", food.bing["apple"], ""},
|
||||
{food.bing["apple"], "", food.bing["apple"]},
|
||||
{"", food.bing["apple"], ""}
|
||||
}
|
||||
})
|
||||
end, true)
|
||||
end
|
||||
|
||||
if (food.bing["bucket_water"] ~= "none" or food.bing["bucket_river_water"] ~= "none" )
|
||||
and food.bing["sand"] ~= "none" then
|
||||
local repl_bucket = food.bing["bucket_empty"] ~= "none" and
|
||||
{{"group:food_water_bucket", food.bing["bucket_empty"]}} or nil
|
||||
|
||||
food.module("milk", function()
|
||||
minetest.register_craftitem(":food:milk", {
|
||||
description = S("Milk"),
|
||||
image = "food_milk.png",
|
||||
on_use = food.item_eat(1),
|
||||
groups = { eatable=1, food_milk = 1 },
|
||||
stack_max=10
|
||||
})
|
||||
food.craft({
|
||||
output = "food:milk",
|
||||
recipe = {
|
||||
{"group:food_wheat"},
|
||||
{"group:food_water_bucket"}
|
||||
},
|
||||
replacements = repl_bucket
|
||||
})
|
||||
end, true)
|
||||
end
|
||||
|
||||
if food.bing["sand"] ~= "none" then
|
||||
food.module("egg", function()
|
||||
minetest.register_craftitem(":food:egg", {
|
||||
description = S("Egg"),
|
||||
inventory_image = "food_egg.png",
|
||||
groups = {food_egg=1}
|
||||
})
|
||||
food.craft({
|
||||
output = "food:egg",
|
||||
recipe = {
|
||||
{"", food.bing["sand"], ""},
|
||||
{food.bing["sand"], "", food.bing["sand"]},
|
||||
{"", food.bing["sand"], ""}
|
||||
}
|
||||
})
|
||||
end, true)
|
||||
end
|
||||
|
||||
if food.bing["papyrus"] ~= "none" then
|
||||
food.module("sugar", function()
|
||||
minetest.register_craftitem(":food:sugar", {
|
||||
description = S("Sugar"),
|
||||
inventory_image = "food_sugar.png",
|
||||
groups = {food_sugar=1}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "food:sugar",
|
||||
recipe = {food.bing["papyrus"]},
|
||||
})
|
||||
end, true)
|
||||
end
|
||||
|
||||
if food.bing["clay"] ~= "none" then
|
||||
food.module("bowl", function()
|
||||
minetest.register_craftitem(":food:bowl",{
|
||||
description = S("Bowl"),
|
||||
inventory_image = "food_bowl.png",
|
||||
groups = {food_bowl=1}
|
||||
})
|
||||
food.craft({
|
||||
output = "food:bowl",
|
||||
recipe = {
|
||||
{food.bing["clay"],"",food.bing["clay"]},
|
||||
{"",food.bing["clay"],""}
|
||||
}
|
||||
})
|
||||
end, true)
|
||||
end
|
||||
|
||||
food.module("chocolate_powder", function()
|
||||
minetest.register_craftitem(":food:chocolate_powder", {
|
||||
@ -239,50 +249,25 @@ food.module("pasta", function()
|
||||
})
|
||||
end, true)
|
||||
|
||||
food.module("bowl", function()
|
||||
minetest.register_craftitem(":food:bowl",{
|
||||
description = S("Bowl"),
|
||||
inventory_image = "food_bowl.png",
|
||||
groups = {food_bowl=1}
|
||||
})
|
||||
food.craft({
|
||||
output = "food:bowl",
|
||||
recipe = {
|
||||
{"default:clay_lump","","default:clay_lump"},
|
||||
{"","default:clay_lump",""}
|
||||
}
|
||||
})
|
||||
end, true)
|
||||
|
||||
food.module("butter", function()
|
||||
minetest.register_craftitem(":food:butter", {
|
||||
description = S("Butter"),
|
||||
inventory_image = "food_butter.png",
|
||||
groups = {food_butter=1}
|
||||
})
|
||||
food.craft({
|
||||
output = "food:butter",
|
||||
recipe = {{"group:food_milkbucket","group:food_milkbucket"}},
|
||||
replacements = {
|
||||
{"group:food_milkbucket","bucket:bucket_empty"},
|
||||
{"group:food_milkbucket","bucket:bucket_empty"}
|
||||
},
|
||||
})
|
||||
food.craft({
|
||||
output = "food:butter",
|
||||
recipe = {
|
||||
{"group:food_milk","group:food_milkbucket"}
|
||||
},
|
||||
replacements = {
|
||||
{"group:food_milkbucket","bucket:bucket_empty"},
|
||||
},
|
||||
})
|
||||
food.craft({
|
||||
output = "food:butter",
|
||||
recipe = {
|
||||
{"group:food_milk","group:food_milk"},
|
||||
}
|
||||
})
|
||||
local replacements = food.bing["bucket_empty"] ~= "none" and {{"group:food_milkbucket", food.bing["bucket_empty"].." 2"}}
|
||||
or nil
|
||||
food.craft({
|
||||
output = "food:butter 2",
|
||||
recipe = {{"group:food_milkbucket","group:food_milkbucket"}},
|
||||
replacements = replacements
|
||||
})
|
||||
end, true)
|
||||
|
||||
food.module("cheese", function()
|
||||
@ -299,12 +284,3 @@ food.module("cheese", function()
|
||||
}
|
||||
})
|
||||
end, true)
|
||||
|
||||
if (minetest.get_modpath("animalmaterials") and not minetest.get_modpath("mobfcooking")) then
|
||||
food.craft({
|
||||
type = "cooking",
|
||||
output = "food:meat",
|
||||
recipe = "animalmaterials:meat_raw",
|
||||
cooktime = 30
|
||||
})
|
||||
end
|
||||
|
Reference in New Issue
Block a user