summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRubenwardy <anjayward@gmail.com>2013-09-10 18:35:04 +0100
committerRubenwardy <anjayward@gmail.com>2013-09-10 18:35:04 +0100
commitc40055af83fb46ff2e00d8a0c0b76c494c9c3a97 (patch)
tree01b94eb38f0a51db02f52e8de490aeaf40eb4954
parentde199c93be252bf28c733ecd3b01e295fb7b1445 (diff)
Soup and BetterHud support
-rw-r--r--depends.txt1
-rw-r--r--init.lua95
-rw-r--r--textures/food_soup_chicken.pngbin0 -> 355 bytes
-rw-r--r--textures/food_soup_chicken_raw.pngbin0 -> 325 bytes
-rw-r--r--textures/food_soup_tomato.pngbin0 -> 1216 bytes
-rw-r--r--textures/food_soup_tomato_raw.pngbin0 -> 321 bytes
6 files changed, 88 insertions, 8 deletions
diff --git a/depends.txt b/depends.txt
index 4efe608..928e6b7 100644
--- a/depends.txt
+++ b/depends.txt
@@ -5,3 +5,4 @@ plantlib?
docfarming?
animalmaterials?
my_mobs?
+hud?
diff --git a/init.lua b/init.lua
index f44f02e..4cfd58b 100644
--- a/init.lua
+++ b/init.lua
@@ -52,6 +52,13 @@ function food.asupport(group,add)
add()
end
+function food.item_eat(amt)
+ if minetest.get_modpath("hud") then
+ return hud.item_eat(hunger_change)
+ else
+ return minetest.item_eat(amt)
+ end
+end
-- Add support for other mods
food.support("wheat","farming","farming:wheat")
@@ -67,6 +74,9 @@ food.support("cocoa","farming_plus","farming_plus:cocoa_bean")
food.support("milk","animalmaterials","animalmaterials:milk")
food.support("milk","my_mobs","my_mobs:milk_glass_cup")
food.support("egg","animalmaterials","animalmaterials:egg")
+--food.support("meat_raw","mobs","mobs:meat_raw")
+food.support("meat_raw","animalmaterials","animalmaterials:meat_raw")
+food.support("meat","mobs","mobs:meat")
-- Default inbuilt ingrediants
food.asupport("wheat",function()
@@ -123,7 +133,7 @@ food.asupport("strawberry",function()
minetest.register_craftitem("food:strawberry", {
description = "Strawberry",
inventory_image = "food_strawberry.png",
- on_use = minetest.item_eat(2),
+ on_use = food.item_eat(2),
groups = {food_strawberry=1}
})
minetest.register_craft({
@@ -138,7 +148,7 @@ food.asupport("carrot",function()
description = "Carrot",
inventory_image = "food_carrot.png",
groups = {food_carrot=1},
- on_use = minetest.item_eat(3)
+ on_use = food.item_eat(3)
})
minetest.register_craft({
output = "food:carrot",
@@ -151,7 +161,7 @@ food.asupport("milk",function()
minetest.register_craftitem("food:milk", {
description = "Milk",
image = "food_milk.png",
- on_use = minetest.item_eat(1),
+ on_use = food.item_eat(1),
groups = { eatable=1, food_milk = 1 },
stack_max=10
})
@@ -194,6 +204,36 @@ food.asupport("cocoa",function()
}
})
end)
+food.asupport("meat_raw",function()
+ minetest.register_craftitem("food:meat_raw", {
+ description = "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
+ })
+ minetest.register_craft({
+ output = "food:meat_raw",
+ recipe = {
+ {"default:apple"},
+ {"default:dirt"}
+ }
+ })
+end)
+food.asupport("food:meat",function()
+ minetest.register_craftitem("food:meat", {
+ description = "Venison",
+ inventory_image = "food_meat.png",
+ groups = {food_meat=1,food_chicken=1}
+ })
+
+ minetest.register_craft({
+ type = "cooking",
+ output = "food:meat",
+ recipe = "group:food_meat_raw",
+ cooktime = 30
+ })
+end)
-- Register sugar
minetest.register_craftitem("food:sugar", {
@@ -268,6 +308,13 @@ minetest.register_craftitem("food:bowl",{
inventory_image = "food_bowl.png",
groups = {food_bowl=1}
})
+minetest.register_craft({
+ output = "food:bowl",
+ recipe = {
+ {"default:clay_lump","","default:clay_lump"},
+ {"","default:clay_lump",""}
+ }
+})
-- Register butter
minetest.register_craftitem("food:butter", {
description = "Butter",
@@ -285,7 +332,7 @@ minetest.register_craft({
minetest.register_craftitem("food:cheese", {
description = "Cheese",
inventory_image = "food_cheese.png",
- on_use = minetest.item_eat(4),
+ on_use = food.item_eat(4),
groups = {food_cheese=1}
})
minetest.register_craft({
@@ -299,6 +346,7 @@ minetest.register_craft({
minetest.register_craftitem("food:pasta_bake",{
description = "Pasta Bake",
inventory_image = "food_pasta_bake.png",
+ on_use = food.item_eat(4),
groups = {food=3}
})
minetest.register_craftitem("food:pasta_bake_raw",{
@@ -319,10 +367,41 @@ minetest.register_craft({
}
})
+-- Soups
+local soups = {"tomato","chicken"}
+for i=1, #soups do
+ local flav = soups[i]
+ minetest.register_craftitem("food:soup_"..flav,{
+ description = flav.." Soup",
+ inventory_image = "food_soup_"..flav..".png",
+ on_use = food.item_eat(4),
+ groups = {food=3}
+ })
+ minetest.register_craftitem("food:soup_"..flav.."_raw",{
+ description = "Uncooked ".. flav.." Soup",
+ inventory_image = "food_soup_"..flav.."_raw.png",
+
+ })
+ minetest.register_craft({
+ type = "cooking",
+ output = "food:soup_"..flav,
+ recipe = "food:soup_"..flav.."_raw",
+ })
+ minetest.register_craft({
+ output = "food:soup_"..flav.."_raw",
+ recipe = {
+ {"", "", ""},
+ {"bucket:bucket_water", "group:food_"..flav, "bucket:bucket_water"},
+ {"", "group:food_bowl", ""},
+ },
+ replacements = {{"bucket:bucket_water", "bucket:bucket_empty"},{"bucket:bucket_water", "bucket:bucket_empty"}}
+ })
+end
+
-- Register cakes
minetest.register_node("food:cake", {
description = "Cake",
- on_use = minetest.item_eat(4),
+ on_use = food.item_eat(4),
groups={food=3,crumbly=3},
tiles = {
"food_cake_texture.png",
@@ -347,7 +426,7 @@ minetest.register_node("food:cake", {
})
minetest.register_node("food:cake_choco", {
description = "Chocolate Cake",
- on_use = minetest.item_eat(4),
+ on_use = food.item_eat(4),
groups={food=3,crumbly=3},
tiles = {
"food_cake_choco_texture.png",
@@ -372,7 +451,7 @@ minetest.register_node("food:cake_choco", {
})
minetest.register_node("food:cake_carrot", {
description = "Carrot Cake",
- on_use = minetest.item_eat(4),
+ on_use = food.item_eat(4),
groups={food=3,crumbly=3},
walkable = false,
sunlight_propagates = true,
@@ -398,7 +477,7 @@ minetest.register_node("food:cake_carrot", {
minetest.register_craftitem("food:cake_cheese",{
description = "Cheese cake",
inventory_image = "food_cake_cheese.png",
- on_use = minetest.item_eat(4),
+ on_use = food.item_eat(4),
groups={food=3,crumbly=3}
})
minetest.register_craft({
diff --git a/textures/food_soup_chicken.png b/textures/food_soup_chicken.png
new file mode 100644
index 0000000..db9f10d
--- /dev/null
+++ b/textures/food_soup_chicken.png
Binary files differ
diff --git a/textures/food_soup_chicken_raw.png b/textures/food_soup_chicken_raw.png
new file mode 100644
index 0000000..0cf6b21
--- /dev/null
+++ b/textures/food_soup_chicken_raw.png
Binary files differ
diff --git a/textures/food_soup_tomato.png b/textures/food_soup_tomato.png
new file mode 100644
index 0000000..5cc23be
--- /dev/null
+++ b/textures/food_soup_tomato.png
Binary files differ
diff --git a/textures/food_soup_tomato_raw.png b/textures/food_soup_tomato_raw.png
new file mode 100644
index 0000000..1eac22c
--- /dev/null
+++ b/textures/food_soup_tomato_raw.png
Binary files differ