forked from mtcontrib/food
Merge branch 'github'
This commit is contained in:
commit
a05de3929e
@ -10,13 +10,13 @@ food = {
|
|||||||
modules = {},
|
modules = {},
|
||||||
disabled_modules = {},
|
disabled_modules = {},
|
||||||
debug = false,
|
debug = false,
|
||||||
version = 2.3,
|
version = 2.4,
|
||||||
disable_fallbacks =
|
disable_fallbacks =
|
||||||
minetest.setting_getbool("food.disable_fallbacks")
|
minetest.settings:get_bool("food.disable_fallbacks")
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Checks for external content, and adds support
|
-- Checks for external content, and adds support
|
||||||
function food.support(group, item)
|
function food.support(group, item, add_it)
|
||||||
if type(group) == "table" then
|
if type(group) == "table" then
|
||||||
for i = 1, #group do
|
for i = 1, #group do
|
||||||
food.support(group[i], item)
|
food.support(group[i], item)
|
||||||
@ -49,8 +49,7 @@ function food.support(group, item)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if not add_it then food.disable(group) end
|
||||||
food.disable(group)
|
|
||||||
|
|
||||||
-- Add group
|
-- Add group
|
||||||
local g = {}
|
local g = {}
|
||||||
@ -168,9 +167,9 @@ local global_exists = minetest.global_exists or function(name)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Checks for hunger mods to register food on
|
-- Checks for hunger mods to register food on
|
||||||
function food.item_eat(amt)
|
function food.item_eat(amt, repl_item)
|
||||||
if minetest.get_modpath("diet") and global_exists("diet") and diet.item_eat then
|
if minetest.get_modpath("diet") and global_exists("diet") and diet.item_eat then
|
||||||
return diet.item_eat(amt)
|
return diet.item_eat(amt, repl_item)
|
||||||
elseif minetest.get_modpath("hud") and global_exists("hud") and hud.item_eat then
|
elseif minetest.get_modpath("hud") and global_exists("hud") and hud.item_eat then
|
||||||
return hud.item_eat(amt)
|
return hud.item_eat(amt)
|
||||||
elseif minetest.get_modpath("hbhunger") then
|
elseif minetest.get_modpath("hbhunger") then
|
||||||
@ -182,13 +181,14 @@ function food.item_eat(amt)
|
|||||||
return hunger.item_eat(amt)
|
return hunger.item_eat(amt)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
return minetest.item_eat(amt)
|
return minetest.item_eat(amt, repl_item)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Registers craft item or node depending on settings
|
-- Registers craft item or node depending on settings
|
||||||
function food.register(name, data, mod)
|
function food.register(name, data, mod)
|
||||||
if (minetest.setting_getbool("food_use_2d") or (mod ~= nil and minetest.setting_getbool("food_"..mod.."_use_2d"))) then
|
if (minetest.settings:get_bool("food_use_2d")
|
||||||
|
or (mod and minetest.setting_getbool("food_"..mod.."_use_2d"))) then
|
||||||
minetest.register_craftitem(name,{
|
minetest.register_craftitem(name,{
|
||||||
description = data.description,
|
description = data.description,
|
||||||
inventory_image = data.inventory_image,
|
inventory_image = data.inventory_image,
|
||||||
|
@ -3,7 +3,7 @@ The Food Mod
|
|||||||
|
|
||||||
This is the main mod in the food mod collection.
|
This is the main mod in the food mod collection.
|
||||||
|
|
||||||
Version 2.3
|
Version 2.4
|
||||||
|
|
||||||
The Aims
|
The Aims
|
||||||
--------
|
--------
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
food
|
food
|
||||||
animalmaterials?
|
animalmaterials?
|
||||||
|
bucket?
|
||||||
bushes?
|
bushes?
|
||||||
bushes_classic?
|
bushes_classic?
|
||||||
default?
|
default?
|
||||||
|
@ -14,18 +14,17 @@ else
|
|||||||
S = function ( s ) return s end
|
S = function ( s ) return s end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if food.bing["dry_shrub"] ~= "none" then
|
||||||
food.module("wheat", function()
|
food.module("wheat", function()
|
||||||
minetest.register_craftitem(":food:wheat", {
|
minetest.register_craftitem(":food:wheat", {
|
||||||
description = S("Wheat"),
|
description = S("Wheat"),
|
||||||
inventory_image = "food_wheat.png",
|
inventory_image = "food_wheat.png",
|
||||||
groups = {food_wheat=1}
|
groups = {food_wheat=1}
|
||||||
})
|
})
|
||||||
|
|
||||||
food.craft({
|
food.craft({
|
||||||
|
type = "shapeless",
|
||||||
output = "food:wheat",
|
output = "food:wheat",
|
||||||
recipe = {
|
recipe = {food.bing["dry_shrub"]}
|
||||||
{"default:dry_shrub"},
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
end, true)
|
end, true)
|
||||||
|
|
||||||
@ -42,15 +41,10 @@ food.module("flour", function()
|
|||||||
{"group:food_wheat"}
|
{"group:food_wheat"}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
food.craft({
|
|
||||||
output = "food:flour",
|
|
||||||
recipe = {
|
|
||||||
{"default:sand"},
|
|
||||||
{"default:sand"}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
end, true)
|
end, true)
|
||||||
|
end
|
||||||
|
|
||||||
|
if food.bing["dirt"] ~= "none" and food.bing["apple"] ~= "none" then
|
||||||
food.module("potato", function()
|
food.module("potato", function()
|
||||||
minetest.register_craftitem(":food:potato", {
|
minetest.register_craftitem(":food:potato", {
|
||||||
description = S("Potato"),
|
description = S("Potato"),
|
||||||
@ -60,13 +54,31 @@ food.module("potato", function()
|
|||||||
food.craft({
|
food.craft({
|
||||||
output = "food:potato",
|
output = "food:potato",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"default:dirt"},
|
{food.bing["dirt"]},
|
||||||
{"default:apple"}
|
{food.bing["apple"]}
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
end, true)
|
end, true)
|
||||||
|
|
||||||
|
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=1, food_meat_raw=1 },
|
||||||
|
stack_max=25
|
||||||
|
})
|
||||||
|
food.craft({
|
||||||
|
output = "food:meat_raw",
|
||||||
|
recipe = {
|
||||||
|
{food.bing["apple"]},
|
||||||
|
{food.bing["dirt"]}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end, true)
|
||||||
|
end
|
||||||
|
|
||||||
|
if food.bing["desert_sand"] ~= "none" then
|
||||||
food.module("orange", function()
|
food.module("orange", function()
|
||||||
minetest.register_craftitem(":food:orange", {
|
minetest.register_craftitem(":food:orange", {
|
||||||
description = S("Orange"),
|
description = S("Orange"),
|
||||||
@ -76,9 +88,9 @@ food.module("orange", function()
|
|||||||
food.craft({
|
food.craft({
|
||||||
output = "food:orange",
|
output = "food:orange",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"", "default:desert_sand", ""},
|
{"", food.bing["desert_sand"], ""},
|
||||||
{"default:desert_sand", "default:desert_sand", "default:desert_sand"},
|
{food.bing["desert_sand"], food.bing["desert_sand"], food.bing["desert_sand"]},
|
||||||
{"", "default:desert_sand", ""}
|
{"", food.bing["desert_sand"], ""}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
end, true)
|
end, true)
|
||||||
@ -92,13 +104,15 @@ food.module("tomato", function()
|
|||||||
food.craft({
|
food.craft({
|
||||||
output = "food:tomato",
|
output = "food:tomato",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"", "default:desert_sand", ""},
|
{"", food.bing["desert_sand"], ""},
|
||||||
{"default:desert_sand", "", "default:desert_sand"},
|
{food.bing["desert_sand"], "", food.bing["desert_sand"]},
|
||||||
{"", "default:desert_sand", ""}
|
{"", food.bing["desert_sand"], ""}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
end, true)
|
end, true)
|
||||||
|
end
|
||||||
|
|
||||||
|
if food.bing["apple"] ~= "none" then
|
||||||
food.module("carrot", function()
|
food.module("carrot", function()
|
||||||
minetest.register_craftitem(":food:carrot", {
|
minetest.register_craftitem(":food:carrot", {
|
||||||
description = S("Carrot"),
|
description = S("Carrot"),
|
||||||
@ -109,41 +123,7 @@ food.module("carrot", function()
|
|||||||
food.craft({
|
food.craft({
|
||||||
output = "food:carrot",
|
output = "food:carrot",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"default:apple", "default:apple", "default:apple"},
|
{food.bing["apple"], food.bing["apple"], food.bing["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)
|
end, true)
|
||||||
@ -157,44 +137,57 @@ food.module("cocoa", function()
|
|||||||
food.craft({
|
food.craft({
|
||||||
output = "food:cocoa",
|
output = "food:cocoa",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"", "default:apple", ""},
|
{"", food.bing["apple"], ""},
|
||||||
{"default:apple", "", "default:apple"},
|
{food.bing["apple"], "", food.bing["apple"]},
|
||||||
{"", "default:apple", ""}
|
{"", food.bing["apple"], ""}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
end, true)
|
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
|
|
||||||
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 },
|
|
||||||
stack_max=25
|
|
||||||
})
|
|
||||||
food.craft({
|
|
||||||
output = "food:meat_raw",
|
|
||||||
recipe = {
|
|
||||||
{"default:apple"},
|
|
||||||
{"default:dirt"}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
end, true)
|
|
||||||
|
|
||||||
|
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()
|
food.module("sugar", function()
|
||||||
minetest.register_craftitem(":food:sugar", {
|
minetest.register_craftitem(":food:sugar", {
|
||||||
description = S("Sugar"),
|
description = S("Sugar"),
|
||||||
@ -203,12 +196,29 @@ food.module("sugar", function()
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "food:sugar 20",
|
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 = {
|
recipe = {
|
||||||
{"default:papyrus"},
|
{food.bing["clay"],"",food.bing["clay"]},
|
||||||
|
{"",food.bing["clay"],""}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
end, true)
|
end, true)
|
||||||
|
end
|
||||||
|
|
||||||
food.module("chocolate_powder", function()
|
food.module("chocolate_powder", function()
|
||||||
minetest.register_craftitem(":food:chocolate_powder", {
|
minetest.register_craftitem(":food:chocolate_powder", {
|
||||||
@ -239,50 +249,25 @@ food.module("pasta", function()
|
|||||||
})
|
})
|
||||||
end, true)
|
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()
|
food.module("butter", function()
|
||||||
minetest.register_craftitem(":food:butter", {
|
minetest.register_craftitem(":food:butter", {
|
||||||
description = S("Butter"),
|
description = S("Butter"),
|
||||||
inventory_image = "food_butter.png",
|
inventory_image = "food_butter.png",
|
||||||
groups = {food_butter=1}
|
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({
|
food.craft({
|
||||||
output = "food:butter",
|
output = "food:butter",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"group:food_milk","group:food_milk"},
|
{"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)
|
end, true)
|
||||||
|
|
||||||
food.module("cheese", function()
|
food.module("cheese", function()
|
||||||
@ -299,12 +284,3 @@ food.module("cheese", function()
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
end, true)
|
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
|
|
||||||
|
@ -6,8 +6,9 @@
|
|||||||
-- Some basic foods
|
-- Some basic foods
|
||||||
-- =====================================
|
-- =====================================
|
||||||
|
|
||||||
print("Food Mod - Version 2.3")
|
print("Food Mod - Version 2.4")
|
||||||
|
|
||||||
|
dofile(minetest.get_modpath("food_basic").."/settings.lua")
|
||||||
dofile(minetest.get_modpath("food_basic").."/support.lua")
|
dofile(minetest.get_modpath("food_basic").."/support.lua")
|
||||||
dofile(minetest.get_modpath("food_basic").."/ingredients.lua")
|
dofile(minetest.get_modpath("food_basic").."/ingredients.lua")
|
||||||
|
|
||||||
@ -19,6 +20,21 @@ else
|
|||||||
S = function ( s ) return s end
|
S = function ( s ) return s end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Register Venison
|
||||||
|
food.module("meat_cooked", function()
|
||||||
|
minetest.register_craftitem(":food:meat", {
|
||||||
|
description = S("Venison"),
|
||||||
|
inventory_image = "food_meat.png",
|
||||||
|
groups = {food_meat=1, food_meat_cooked=1}
|
||||||
|
})
|
||||||
|
food.craft({
|
||||||
|
type = "cooking",
|
||||||
|
output = "food:meat",
|
||||||
|
recipe = "group:food_meat_raw",
|
||||||
|
cooktime = 30
|
||||||
|
})
|
||||||
|
end)
|
||||||
|
|
||||||
-- Register dark chocolate
|
-- Register dark chocolate
|
||||||
food.module("dark_chocolate", function()
|
food.module("dark_chocolate", function()
|
||||||
minetest.register_craftitem(":food:dark_chocolate",{
|
minetest.register_craftitem(":food:dark_chocolate",{
|
||||||
@ -48,7 +64,10 @@ food.module("milk_chocolate", function()
|
|||||||
recipe = {
|
recipe = {
|
||||||
{"","group:food_milk",""},
|
{"","group:food_milk",""},
|
||||||
{"group:food_cocoa","group:food_cocoa","group:food_cocoa"}
|
{"group:food_cocoa","group:food_cocoa","group:food_cocoa"}
|
||||||
}
|
},
|
||||||
|
replacements = {{"mobs:bucket_milk", "bucket:bucket_empty"},
|
||||||
|
{"mobs:glass_milk", "vessels:drinking_glass"},
|
||||||
|
{"farming:soy_milk", "vessels:drinking_glass"}}
|
||||||
})
|
})
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@ -89,19 +108,17 @@ food.module("pasta_bake", function()
|
|||||||
{"group:food_cheese"},
|
{"group:food_cheese"},
|
||||||
{"group:food_pasta"},
|
{"group:food_pasta"},
|
||||||
{"group:food_bowl"}
|
{"group:food_bowl"}
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Register Soups
|
-- Register Soups
|
||||||
local chicken = "meat"
|
|
||||||
if minetest.get_modpath("mobs") and mobs.mod == "redo" then
|
|
||||||
chicken = "chicken"
|
|
||||||
end
|
|
||||||
local soups = {
|
local soups = {
|
||||||
{"tomato", "tomato"},
|
{"tomato", "tomato"},
|
||||||
{"chicken", chicken}
|
{"chicken", "meat_raw"}
|
||||||
}
|
}
|
||||||
|
local repl_bucket = food.bing["bucket_empty"] ~= "none" and
|
||||||
|
{{"group:food_water_bucket", food.bing["bucket_empty"].." 2"}} or nil
|
||||||
for i=1, #soups do
|
for i=1, #soups do
|
||||||
local flav = soups[i]
|
local flav = soups[i]
|
||||||
food.module("soup_"..flav[1], function()
|
food.module("soup_"..flav[1], function()
|
||||||
@ -114,7 +131,6 @@ for i=1, #soups do
|
|||||||
minetest.register_craftitem(":food:soup_"..flav[1].."_raw",{
|
minetest.register_craftitem(":food:soup_"..flav[1].."_raw",{
|
||||||
description = S("Uncooked ".. flav[1].." Soup"),
|
description = S("Uncooked ".. flav[1].." Soup"),
|
||||||
inventory_image = "food_soup_"..flav[1].."_raw.png",
|
inventory_image = "food_soup_"..flav[1].."_raw.png",
|
||||||
|
|
||||||
})
|
})
|
||||||
food.craft({
|
food.craft({
|
||||||
type = "cooking",
|
type = "cooking",
|
||||||
@ -125,10 +141,10 @@ for i=1, #soups do
|
|||||||
output = "food:soup_"..flav[1].."_raw",
|
output = "food:soup_"..flav[1].."_raw",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"", "", ""},
|
{"", "", ""},
|
||||||
{"bucket:bucket_water", "group:food_"..flav[2], "bucket:bucket_water"},
|
{"group:food_water_bucket", "group:food_"..flav[2], "group:food_water_bucket"},
|
||||||
{"", "group:food_bowl", ""},
|
{"", "group:food_bowl", ""},
|
||||||
},
|
},
|
||||||
replacements = {{"bucket:bucket_water", "bucket:bucket_empty"},{"bucket:bucket_water", "bucket:bucket_empty"}}
|
replacements = repl_bucket
|
||||||
})
|
})
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
@ -141,14 +157,15 @@ for i=1, #juices do
|
|||||||
minetest.register_craftitem(":food:"..flav.."_juice", {
|
minetest.register_craftitem(":food:"..flav.."_juice", {
|
||||||
description = S(flav.." Juice"),
|
description = S(flav.." Juice"),
|
||||||
inventory_image = "food_"..flav.."_juice.png",
|
inventory_image = "food_"..flav.."_juice.png",
|
||||||
on_use = food.item_eat(2),
|
on_use = food.item_eat(2, food.bing["cup"]),
|
||||||
|
groups = {["food_"..flav.."_juice"] = 1, vessel = 1}
|
||||||
})
|
})
|
||||||
food.craft({
|
food.craft({
|
||||||
output = "food:"..flav.."_juice 4",
|
output = "food:"..flav.."_juice",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"","",""},
|
{"","",""},
|
||||||
{"","group:food_"..flav,""},
|
{"","group:food_"..flav,""},
|
||||||
{"","group:food_cup",""},
|
{"",food.bing["cup"],""},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
end)
|
end)
|
||||||
@ -158,15 +175,26 @@ food.module("rainbow_juice", function()
|
|||||||
minetest.register_craftitem(":food:rainbow_juice", {
|
minetest.register_craftitem(":food:rainbow_juice", {
|
||||||
description = S("Rainbow Juice"),
|
description = S("Rainbow Juice"),
|
||||||
inventory_image = "food_rainbow_juice.png",
|
inventory_image = "food_rainbow_juice.png",
|
||||||
on_use = food.item_eat(20),
|
on_use = food.item_eat(20, food.bing["cup"]),
|
||||||
|
groups = { vessel = 1 }
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if minetest.registered_items["default:nyancat_rainbow"] then
|
||||||
food.craft({
|
food.craft({
|
||||||
output = "food:rainbow_juice 99",
|
output = "food:rainbow_juice 99",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"","",""},
|
{"","",""},
|
||||||
{"","default:nyancat_rainbow",""},
|
{"","default:nyancat_rainbow",""},
|
||||||
{"","group:food_cup",""},
|
{"",food.bing["cup"],""},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
food.craft({
|
||||||
|
output = "food:rainbow_juice 3",
|
||||||
|
recipe = {
|
||||||
|
{"group:food_apple_juice","group:food_apple_juice","group:food_apple_juice"},
|
||||||
|
{"group:food_orange_juice","group:food_orange_juice","group:food_orange_juice"},
|
||||||
|
{"group:food_cactus_juice","group:food_cactus_juice","group:food_cactus_juice"}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
end)
|
end)
|
||||||
|
16
food_basic/settings.lua
Normal file
16
food_basic/settings.lua
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
food.bing = {} -- List of basic ingredients defined from Minetest settings
|
||||||
|
|
||||||
|
local settings = minetest.settings
|
||||||
|
|
||||||
|
food.bing["desert_sand"] = settings:get("basic_food_desert_sand") or "default:desert_sand"
|
||||||
|
food.bing["sand"] = settings:get("basic_food_sand") or "default:sand"
|
||||||
|
food.bing["dry_shrub"] = settings:get("basic_food_dry_shrub") or "default:dry_shrub"
|
||||||
|
food.bing["dirt"] = settings:get("basic_food_dirt") or "default:dirt"
|
||||||
|
food.bing["apple"] = settings:get("basic_food_apple") or "default:apple"
|
||||||
|
food.bing["cactus"] = settings:get("basic_food_cactus") or "default:cactus"
|
||||||
|
food.bing["bucket_water"] = settings:get("basic_food_bucket_water") or "bucket:bucket_water"
|
||||||
|
food.bing["bucket_river_water"] = settings:get("basic_food_bucket_river_water") or "bucket:bucket_river_water"
|
||||||
|
food.bing["bucket_empty"] = settings:get("basic_food_bucket_empty") or "bucket:bucket_empty"
|
||||||
|
food.bing["papyrus"] = settings:get("basic_food_papyrus") or "default:papyrus"
|
||||||
|
food.bing["clay"] = settings:get("basic_food_clay") or "default:clay_lump"
|
||||||
|
food.bing["cup"] = settings:get("basic_food_cup") or "vessels:drinking_glass"
|
49
food_basic/settingtypes.txt
Normal file
49
food_basic/settingtypes.txt
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
[Basic Ingredients]
|
||||||
|
# Basic ingredient you may use instead of the default one defined by the mod.
|
||||||
|
# Default is "default:dirt".
|
||||||
|
# If you want disable this ingredient you must write "none".
|
||||||
|
basic_food_dirt (Ingredient for potato, raw meat) string default:dirt
|
||||||
|
# Basic ingredient you may use instead of the default one defined by the mod.
|
||||||
|
# Default is "default:sand".
|
||||||
|
# If you want disable this ingredient you must write "none".
|
||||||
|
basic_food_sand (Ingredient for egg) string default:sand
|
||||||
|
# Basic ingredient you may use instead of the default one defined by the mod.
|
||||||
|
# Default is "default:desert_sand".
|
||||||
|
# If you want disable this ingredient you must write "none".
|
||||||
|
basic_food_desert_sand (Ingredient for orange, tomato) string default:desert_sand
|
||||||
|
# Basic ingredient you may use instead of the default one defined by the mod.
|
||||||
|
# Default is "default:apple".
|
||||||
|
# If you want disable this ingredient you must write "none".
|
||||||
|
basic_food_apple (Ingredient for potato, cocoa bean, raw meat, carrot, apple juice) string default:apple
|
||||||
|
# Basic ingredient you may use instead of the default one defined by the mod.
|
||||||
|
# Default is "default:cactus".
|
||||||
|
# If you want disable this ingredient you must write "none".
|
||||||
|
basic_food_cactus (Ingredient for cactus juice) string default:cactus
|
||||||
|
# Basic ingredient you may use instead of the default one defined by the mod.
|
||||||
|
# Default is "default:dry_shrub".
|
||||||
|
# If you want disable this ingredient you must write "none".
|
||||||
|
basic_food_dry_shrub (Ingredient for wheat) string default:dry_shrub
|
||||||
|
# Basic ingredient you may use instead of the default one defined by the mod.
|
||||||
|
# Default is "bucket:bucket_water".
|
||||||
|
# If you want disable this ingredient you must write "none".
|
||||||
|
basic_food_bucket_water (Ingredient for milk, tomato soup, chicken soup) string bucket:bucket_water
|
||||||
|
# Basic ingredient you may use instead of the default one defined by the mod.
|
||||||
|
# Default is "bucket:bucket_river_water".
|
||||||
|
# If you want disable this ingredient you must write "none".
|
||||||
|
basic_food_bucket_river_water (In the same group as basic_food_bucket_water) string bucket:bucket_river_water
|
||||||
|
# Basic ingredient you may use instead of the default one defined by the mod.
|
||||||
|
# Default is "bucket:bucket_empty".
|
||||||
|
# If you want disable this ingredient you must write "none".
|
||||||
|
basic_food_bucket_empty (Item replacement when cooking with the above two ingredients) string bucket:bucket_empty
|
||||||
|
# Basic ingredient you may use instead of the default one defined by the mod.
|
||||||
|
# Default is "default:papyrus".
|
||||||
|
# If you want disable this ingredient you must write "none".
|
||||||
|
basic_food_papyrus (Ingredient for sugar) string default:papyrus
|
||||||
|
# Basic ingredient you may use instead of the default one defined by the mod.
|
||||||
|
# Default is "default:clay_lump".
|
||||||
|
# If you want disable this ingredient you must write "none".
|
||||||
|
basic_food_clay (Ingredient for bowl) string default:clay_lump
|
||||||
|
# Basic ingredient you may use instead of the default one defined by the mod.
|
||||||
|
# Default is "vessels:drinking_glass".
|
||||||
|
# If you want disable this ingredient you must write "none".
|
||||||
|
basic_food_cup (Ingredient for apple|orange|cactus juice) string vessels:drinking_glass
|
@ -12,35 +12,52 @@
|
|||||||
-- good for the end user
|
-- good for the end user
|
||||||
|
|
||||||
-- Add support for other mods
|
-- Add support for other mods
|
||||||
food.support("cocoa", "farming_plus:cocoa_bean")
|
food.support("flour", {
|
||||||
food.support("cup", "vessels:drinking_glass")
|
"farming:flour",
|
||||||
food.support("cactus", "default:cactus")
|
"farming:flour_multigrain",
|
||||||
food.support("apple", "default:apple")
|
})
|
||||||
|
food.support("wheat", "farming:wheat")
|
||||||
|
food.support("bowl", "farming:bowl")
|
||||||
|
food.support("cocoa", {"farming_plus:cocoa_bean", "farming:cocoa_beans"})
|
||||||
|
food.support("cup", food.bing["cup"])
|
||||||
|
food.support("cactus", food.bing["cactus"])
|
||||||
|
food.support("apple", food.bing["apple"])
|
||||||
food.support("orange", {
|
food.support("orange", {
|
||||||
"farming_plus:orange_item",
|
"farming_plus:orange_item",
|
||||||
"ethereal:orange",
|
"ethereal:orange"
|
||||||
})
|
})
|
||||||
food.disable_if("ethereal", "orange")
|
food.disable_if("ethereal", "orange")
|
||||||
|
|
||||||
food.support("potato", {
|
food.support("potato", {
|
||||||
"docfarming:potato",
|
"docfarming:potato",
|
||||||
"veggies:potato",
|
"veggies:potato",
|
||||||
"farming_plus:potato_item"
|
"farming_plus:potato_item",
|
||||||
|
"farming:potato"
|
||||||
})
|
})
|
||||||
food.support("tomato", {
|
food.support("tomato", {
|
||||||
"farming_plus:tomato_item",
|
"farming_plus:tomato_item",
|
||||||
"plantlib:tomato"
|
"plantlib:tomato",
|
||||||
|
"farming:tomato"
|
||||||
})
|
})
|
||||||
food.support("carrot", {
|
food.support("carrot", {
|
||||||
"farming_plus:carrot_item",
|
"farming_plus:carrot_item",
|
||||||
"docfarming:carrot",
|
"docfarming:carrot",
|
||||||
"plantlib:carrot",
|
"plantlib:carrot",
|
||||||
"jkfarming:carrot"
|
"jkfarming:carrot",
|
||||||
|
"farming:carrot"
|
||||||
})
|
})
|
||||||
food.support("milk", {
|
food.support("milk", {
|
||||||
"animalmaterials:milk",
|
"animalmaterials:milk",
|
||||||
"my_mobs:milk_glass_cup",
|
"my_mobs:milk_glass_cup",
|
||||||
"mtfoods:dandelion_milk"
|
"mtfoods:dandelion_milk",
|
||||||
|
"mobs:glass_milk",
|
||||||
|
"farming:soy_milk"
|
||||||
|
})
|
||||||
|
food.support("butter", "mobs:butter")
|
||||||
|
food.support("cheese", "mobs:cheese")
|
||||||
|
food.support("water_bucket", {
|
||||||
|
food.bing["bucket_water"],
|
||||||
|
food.bing["bucket_river_water"]
|
||||||
})
|
})
|
||||||
food.support("milkbucket", {
|
food.support("milkbucket", {
|
||||||
"jkanimals:bucket_milk",
|
"jkanimals:bucket_milk",
|
||||||
@ -52,42 +69,31 @@ food.support("egg", {
|
|||||||
"jkanimals:egg",
|
"jkanimals:egg",
|
||||||
"mobs:egg"
|
"mobs:egg"
|
||||||
})
|
})
|
||||||
food.support("meat", {
|
food.support("meat_cooked", {
|
||||||
"mobs:meat",
|
"mobs:meat",
|
||||||
"jkanimals:meat",
|
"jkanimals:meat",
|
||||||
"mobfcooking:cooked_pork",
|
"mobfcooking:cooked_pork",
|
||||||
"mobfcooking:cooked_beef",
|
"mobfcooking:cooked_beef",
|
||||||
"mobfcooking:cooked_chicken",
|
"mobfcooking:cooked_chicken",
|
||||||
"mobfcooking:cooked_lamb",
|
"mobfcooking:cooked_lamb",
|
||||||
"mobfcooking:cooked_venison"
|
"mobfcooking:cooked_venison",
|
||||||
|
"farming:tofu_cooked"
|
||||||
|
})
|
||||||
|
food.support("meat_raw", {
|
||||||
|
"mobs:meat_raw",
|
||||||
|
"mobs:chicken_raw",
|
||||||
|
"farming:tofu"
|
||||||
})
|
})
|
||||||
food.support("sugar", {
|
food.support("sugar", {
|
||||||
"jkfarming:sugar",
|
"jkfarming:sugar",
|
||||||
"bushes:sugar",
|
"bushes:sugar",
|
||||||
"mtfoods:sugar"
|
"mtfoods:sugar",
|
||||||
|
"mobs:honey",
|
||||||
|
"farming:sugar"
|
||||||
})
|
})
|
||||||
|
food.support("cactus_juice", "farming:cactus_juice")
|
||||||
if farming and farming.mod == "redo" then
|
food.support("orange_juice", "farming:carrot_juice", true)
|
||||||
food.support("wheat", "farming:wheat")
|
food.support("apple_juice", "farming:pineapple_juice", true)
|
||||||
food.support("flour", "farming:flour")
|
|
||||||
food.support("carrot", "farming:carrot")
|
|
||||||
food.support("potato", "farming:potato")
|
|
||||||
food.support("tomato", "farming:tomato")
|
|
||||||
food.support("cocoa", "farming:cocoa_beans")
|
|
||||||
food.support("coffee", "farming:coffee_beans")
|
|
||||||
food.support("dark_chocolate", "farming:chocolate_dark")
|
food.support("dark_chocolate", "farming:chocolate_dark")
|
||||||
food.support("sugar", "farming:sugar")
|
food.support("baked_potato", "farming:baked_potato")
|
||||||
food.support("cup", "farming:drinking_cup")
|
food.support("pasta", "farming:pasta")
|
||||||
food.disable_if("farming", "baked_potato")
|
|
||||||
else
|
|
||||||
food.support("wheat", "farming:wheat")
|
|
||||||
food.support("flour", "farming:flour")
|
|
||||||
end
|
|
||||||
|
|
||||||
if minetest.get_modpath("mobs") and mobs.mod == "redo" then
|
|
||||||
if minetest.get_modpath("mobs_animal") then
|
|
||||||
food.support("chicken", "mobs:chicken_cooked")
|
|
||||||
else
|
|
||||||
food.support("chicken", "mobs:meat")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
Loading…
Reference in New Issue
Block a user