add helper function for {eatable}
This commit is contained in:
parent
6a15d63c27
commit
948c76d61d
25
fishing.lua
25
fishing.lua
@ -550,21 +550,23 @@ local fish = {
|
||||
for n = 1, #fish do
|
||||
|
||||
local usage
|
||||
local groups
|
||||
local moredesc = ""
|
||||
local groups = nil
|
||||
|
||||
if fish[n][3] > 0 then
|
||||
usage = minetest.item_eat(fish[n][3])
|
||||
groups = {food_fish_raw = 1, ethereal_fish = 1, eatable = fish[n][3]}
|
||||
moredesc = " (♥" .. fish[n][3] .. ")"
|
||||
groups = {food_fish_raw = 1, ethereal_fish = 1}
|
||||
end
|
||||
|
||||
minetest.register_craftitem("ethereal:fish_" .. fish[n][2], {
|
||||
description = S(fish[n][1]) .. moredesc,
|
||||
description = S(fish[n][1]),
|
||||
inventory_image = "ethereal_fish_" .. fish[n][2] .. ".png",
|
||||
on_use = usage,
|
||||
groups = groups
|
||||
})
|
||||
|
||||
if groups then
|
||||
ethereal.add_eatable("ethereal:fish_" .. fish[n][2], fish[n][3])
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -574,13 +576,15 @@ minetest.override_item("ethereal:fish_tetra", {light_source = 3})
|
||||
|
||||
-- cooked fish
|
||||
minetest.register_craftitem(":ethereal:fish_cooked", {
|
||||
description = S("Cooked Fish") .. " (♥5)",
|
||||
description = S("Cooked Fish"),
|
||||
inventory_image = "ethereal_fish_cooked.png",
|
||||
wield_image = "ethereal_fish_cooked.png",
|
||||
groups = {food_fish = 1, flammable = 3, eatable = 5},
|
||||
groups = {food_fish = 1},
|
||||
on_use = minetest.item_eat(5)
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:fish_cooked", 5)
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "ethereal:fish_cooked",
|
||||
@ -590,13 +594,14 @@ minetest.register_craft({
|
||||
|
||||
-- Sashimi
|
||||
minetest.register_craftitem("ethereal:sashimi", {
|
||||
description = S("Sashimi") .. " (♥4)",
|
||||
description = S("Sashimi"),
|
||||
inventory_image = "ethereal_sashimi.png",
|
||||
wield_image = "ethereal_sashimi.png",
|
||||
on_use = minetest.item_eat(4),
|
||||
groups = {eatable = 4}
|
||||
on_use = minetest.item_eat(4)
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:sashimi", 4)
|
||||
|
||||
minetest.register_craft({
|
||||
output = "ethereal:sashimi 2",
|
||||
recipe = {
|
||||
|
169
food.lua
169
food.lua
@ -4,7 +4,7 @@ local S = ethereal.translate
|
||||
|
||||
-- Banana (Heals one heart when eaten)
|
||||
minetest.register_node("ethereal:banana", {
|
||||
description = S("Banana") .. " (♥2)",
|
||||
description = S("Banana"),
|
||||
drawtype = "torchlike",
|
||||
tiles = {"ethereal_banana_single.png"},
|
||||
inventory_image = "ethereal_banana_single.png",
|
||||
@ -17,8 +17,7 @@ minetest.register_node("ethereal:banana", {
|
||||
fixed = {-0.31, -0.5, -0.31, 0.31, 0.5, 0.31}
|
||||
},
|
||||
groups = {
|
||||
food_banana = 1, fleshy = 3, dig_immediate = 3, flammable = 2, eatable = 2,
|
||||
leafdecay = 1, leafdecay_drop = 1
|
||||
food_banana = 1, fleshy = 3, dig_immediate = 3, leafdecay = 1, leafdecay_drop = 1
|
||||
},
|
||||
drop = "ethereal:banana",
|
||||
on_use = minetest.item_eat(2),
|
||||
@ -32,9 +31,11 @@ minetest.register_node("ethereal:banana", {
|
||||
end
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:banana", 2)
|
||||
|
||||
-- Banana Bunch
|
||||
minetest.register_node("ethereal:banana_bunch", {
|
||||
description = S("Banana Bunch") .. " (♥6)",
|
||||
description = S("Banana Bunch"),
|
||||
drawtype = "torchlike",
|
||||
tiles = {"ethereal_banana_bunch.png"},
|
||||
inventory_image = "ethereal_banana_bunch.png",
|
||||
@ -47,8 +48,7 @@ minetest.register_node("ethereal:banana_bunch", {
|
||||
fixed = {-0.31, -0.5, -0.31, 0.31, 0.5, 0.31}
|
||||
},
|
||||
groups = {
|
||||
fleshy = 3, dig_immediate = 3, flammable = 2, eatable = 6,
|
||||
leafdecay = 1, leafdecay_drop = 1
|
||||
fleshy = 3, dig_immediate = 3, leafdecay = 1, leafdecay_drop = 1
|
||||
},
|
||||
drop = "ethereal:banana_bunch",
|
||||
on_use = minetest.item_eat(6),
|
||||
@ -61,6 +61,8 @@ minetest.register_node("ethereal:banana_bunch", {
|
||||
end
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:banana_bunch", 6)
|
||||
|
||||
-- Bunch to Single
|
||||
minetest.register_craft({
|
||||
output = "ethereal:banana 3",
|
||||
@ -93,7 +95,7 @@ minetest.register_craft({
|
||||
|
||||
-- Orange (Heals 2 hearts when eaten)
|
||||
minetest.register_node("ethereal:orange", {
|
||||
description = S("Orange") .. " (♥4)",
|
||||
description = S("Orange"),
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_orange.png"},
|
||||
inventory_image = "farming_orange.png",
|
||||
@ -106,7 +108,7 @@ minetest.register_node("ethereal:orange", {
|
||||
fixed = {-0.27, -0.37, -0.27, 0.27, 0.44, 0.27}
|
||||
},
|
||||
groups = {
|
||||
food_orange = 1, fleshy = 3, dig_immediate = 3, flammable = 2, eatable = 4,
|
||||
food_orange = 1, fleshy = 3, dig_immediate = 3,
|
||||
leafdecay = 3, leafdecay_drop = 1
|
||||
},
|
||||
drop = "ethereal:orange",
|
||||
@ -121,25 +123,30 @@ minetest.register_node("ethereal:orange", {
|
||||
end
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:orange", 4)
|
||||
|
||||
|
||||
-- Pine Nuts (Heals 1/2 heart when eaten)
|
||||
minetest.register_craftitem("ethereal:pine_nuts", {
|
||||
description = S("Pine Nuts") .. " (♥1)",
|
||||
description = S("Pine Nuts"),
|
||||
inventory_image = "ethereal_pine_nuts.png",
|
||||
wield_image = "ethereal_pine_nuts.png",
|
||||
groups = {food_pine_nuts = 1, flammable = 2, eatable = 1},
|
||||
groups = {food_pine_nuts = 1},
|
||||
on_use = minetest.item_eat(1)
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:pine_nuts", 1)
|
||||
|
||||
-- Banana Loaf (Heals 3 hearts when eaten)
|
||||
minetest.register_craftitem("ethereal:banana_bread", {
|
||||
description = S("Banana Loaf") .. " (♥6)",
|
||||
description = S("Banana Loaf"),
|
||||
inventory_image = "ethereal_banana_bread.png",
|
||||
wield_image = "ethereal_banana_bread.png",
|
||||
groups = {food_bread = 1, flammable = 3, eatable = 6},
|
||||
groups = {food_bread = 1},
|
||||
on_use = minetest.item_eat(6)
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:banana_bread", 6)
|
||||
|
||||
-- coconut settings if farming redo found
|
||||
local fredo = minetest.get_modpath("farming") and farming and farming.mod
|
||||
@ -180,13 +187,15 @@ minetest.register_node("ethereal:coconut", {
|
||||
|
||||
-- Coconut Slice (Heals half heart when eaten)
|
||||
minetest.register_craftitem("ethereal:coconut_slice", {
|
||||
description = S("Coconut Slice") .. " (♥1)",
|
||||
description = S("Coconut Slice"),
|
||||
inventory_image = "moretrees_coconut_slice.png",
|
||||
wield_image = "moretrees_coconut_slice.png",
|
||||
groups = {food_coconut_slice = 1, flammable = 1, eatable = 1},
|
||||
groups = {food_coconut_slice = 1},
|
||||
on_use = minetest.item_eat(1)
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:coconut_slice", 1)
|
||||
|
||||
-- coconut slice recipe (farming redo)
|
||||
if fredo then
|
||||
|
||||
@ -209,7 +218,7 @@ minetest.register_craft({
|
||||
|
||||
-- Golden Apple (Found on Healing Tree, heals all 10 hearts)
|
||||
minetest.register_node("ethereal:golden_apple", {
|
||||
description = S("Golden Apple") .. " (♥2)",
|
||||
description = S("Golden Apple"),
|
||||
drawtype = "plantlike",
|
||||
tiles = {"default_apple_gold.png"},
|
||||
inventory_image = "default_apple_gold.png",
|
||||
@ -245,15 +254,17 @@ minetest.register_node("ethereal:golden_apple", {
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
-- Hearty Stew (Heals 5 hearts)
|
||||
minetest.register_craftitem("ethereal:hearty_stew", {
|
||||
description = S("Hearty Stew") .. " (♥10)",
|
||||
description = S("Hearty Stew"),
|
||||
inventory_image = "ethereal_hearty_stew.png",
|
||||
wield_image = "ethereal_hearty_stew.png",
|
||||
on_use = minetest.item_eat(10, "ethereal:bowl"),
|
||||
groups = {eatable = 10}
|
||||
on_use = minetest.item_eat(10, "ethereal:bowl")
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:hearty_stew", 10)
|
||||
|
||||
minetest.register_craft({
|
||||
output = "ethereal:hearty_stew",
|
||||
recipe = {
|
||||
@ -279,14 +290,16 @@ end
|
||||
|
||||
-- Bucket of Cactus Pulp
|
||||
minetest.register_craftitem("ethereal:bucket_cactus", {
|
||||
description = S("Bucket of Cactus Pulp") .. " (♥2)",
|
||||
description = S("Bucket of Cactus Pulp"),
|
||||
inventory_image = "bucket_cactus.png",
|
||||
wield_image = "bucket_cactus.png",
|
||||
stack_max = 1,
|
||||
groups = {vessel = 1, drink = 1, eatable = 2},
|
||||
groups = {vessel = 1, drink = 1},
|
||||
on_use = minetest.item_eat(2, "bucket:bucket_empty"),
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:bucket_cactus", 2)
|
||||
|
||||
minetest.register_craft({
|
||||
output = "ethereal:bucket_cactus",
|
||||
recipe = {{"bucket:bucket_empty","default:cactus"}}
|
||||
@ -295,13 +308,15 @@ minetest.register_craft({
|
||||
|
||||
-- firethorn jelly
|
||||
minetest.register_craftitem("ethereal:firethorn_jelly", {
|
||||
description = S("Firethorn Jelly") .. " (♥2)",
|
||||
description = S("Firethorn Jelly"),
|
||||
inventory_image = "ethereal_firethorn_jelly.png",
|
||||
wield_image = "ethereal_firethorn_jelly.png",
|
||||
on_use = minetest.item_eat(2, "vessels:glass_bottle"),
|
||||
groups = {vessel = 1, eatable = 2}
|
||||
groups = {vessel = 1}
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:firethorn_jelly", 2)
|
||||
|
||||
if minetest.registered_items["farming:bowl"] then
|
||||
|
||||
minetest.register_craft({
|
||||
@ -321,7 +336,7 @@ end
|
||||
|
||||
-- Lemon
|
||||
minetest.register_node("ethereal:lemon", {
|
||||
description = S("Lemon") .. " (♥3)",
|
||||
description = S("Lemon"),
|
||||
drawtype = "plantlike",
|
||||
tiles = {"ethereal_lemon.png"},
|
||||
inventory_image = "ethereal_lemon_fruit.png",
|
||||
@ -334,8 +349,8 @@ minetest.register_node("ethereal:lemon", {
|
||||
fixed = {-0.27, -0.37, -0.27, 0.27, 0.44, 0.27}
|
||||
},
|
||||
groups = {
|
||||
food_lemon = 1, fleshy = 3, dig_immediate = 3, flammable = 2,
|
||||
leafdecay = 3, leafdecay_drop = 1, eatable = 3
|
||||
food_lemon = 1, fleshy = 3, dig_immediate = 3,
|
||||
leafdecay = 3, leafdecay_drop = 1
|
||||
},
|
||||
drop = "ethereal:lemon",
|
||||
on_use = minetest.item_eat(3),
|
||||
@ -349,15 +364,19 @@ minetest.register_node("ethereal:lemon", {
|
||||
end
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:lemon", 3)
|
||||
|
||||
-- Candied Lemon
|
||||
minetest.register_craftitem("ethereal:candied_lemon", {
|
||||
description = S("Candied Lemon") .. " (♥5)",
|
||||
description = S("Candied Lemon"),
|
||||
inventory_image = "ethereal_candied_lemon.png",
|
||||
wield_image = "ethereal_candied_lemon.png",
|
||||
groups = {food_candied_lemon = 1, eatable = 5},
|
||||
groups = {food_candied_lemon = 1},
|
||||
on_use = minetest.item_eat(5)
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:candied_lemon", 5)
|
||||
|
||||
minetest.register_craft({
|
||||
output = "ethereal:candied_lemon",
|
||||
recipe = {
|
||||
@ -370,7 +389,7 @@ minetest.register_craft({
|
||||
|
||||
-- Lemonade
|
||||
minetest.register_node("ethereal:lemonade", {
|
||||
description = S("Lemonade") .. " (♥5)",
|
||||
description = S("Lemonade"),
|
||||
drawtype = "plantlike",
|
||||
tiles = {"ethereal_lemonade.png"},
|
||||
inventory_image = "ethereal_lemonade.png",
|
||||
@ -381,11 +400,13 @@ minetest.register_node("ethereal:lemonade", {
|
||||
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 = 5},
|
||||
groups = {vessel = 1, dig_immediate = 3, attached_node = 1, drink = 1},
|
||||
on_use = minetest.item_eat(5, "vessels:drinking_glass"),
|
||||
sounds = default.node_sound_glass_defaults()
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:lemonade", 5)
|
||||
|
||||
minetest.register_craft({
|
||||
output = "ethereal:lemonade",
|
||||
recipe = {
|
||||
@ -400,7 +421,7 @@ minetest.register_craft({
|
||||
|
||||
-- Olive
|
||||
minetest.register_node("ethereal:olive", {
|
||||
description = S("Olive") .. " (♥1)",
|
||||
description = S("Olive"),
|
||||
drawtype = "plantlike",
|
||||
tiles = {"ethereal_olive.png"},
|
||||
inventory_image = "ethereal_olive_fruit.png",
|
||||
@ -414,8 +435,7 @@ minetest.register_node("ethereal:olive", {
|
||||
fixed = {-0.1, -0.5, -0.1, 0.1, -0.3, 0.1}
|
||||
},
|
||||
groups = {
|
||||
fleshy = 3, dig_immediate = 3, flammable = 2, eatable = 1,
|
||||
leafdecay = 3, leafdecay_drop = 1
|
||||
fleshy = 3, dig_immediate = 3, leafdecay = 3, leafdecay_drop = 1
|
||||
},
|
||||
drop = "ethereal:olive",
|
||||
on_use = minetest.item_eat(1),
|
||||
@ -429,6 +449,8 @@ minetest.register_node("ethereal:olive", {
|
||||
end
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:olive", 1)
|
||||
|
||||
-- Olive Oil
|
||||
minetest.register_craftitem("ethereal:olive_oil", {
|
||||
description = S("Olive Oil"),
|
||||
@ -452,12 +474,13 @@ minetest.register_craft({
|
||||
|
||||
-- Kappa Maki (sushi with cucumber)
|
||||
minetest.register_craftitem("ethereal:sushi_kappamaki", {
|
||||
description = S("Kappa Maki Sushi") .. " (♥3)",
|
||||
description = S("Kappa Maki Sushi"),
|
||||
inventory_image = "ethereal_sushi_kappa_maki.png",
|
||||
on_use = minetest.item_eat(3),
|
||||
groups = {eatable = 3}
|
||||
on_use = minetest.item_eat(3)
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:sushi_kappamaki", 3)
|
||||
|
||||
minetest.register_craft({
|
||||
output = "ethereal:sushi_kappamaki 2",
|
||||
recipe = {
|
||||
@ -468,12 +491,13 @@ minetest.register_craft({
|
||||
|
||||
-- Nigiri (sushi with raw fish)
|
||||
minetest.register_craftitem("ethereal:sushi_nigiri", {
|
||||
description = S("Nigiri Sushi") .. " (♥2)",
|
||||
description = S("Nigiri Sushi"),
|
||||
inventory_image = "ethereal_sushi_nigiri.png",
|
||||
on_use = minetest.item_eat(2),
|
||||
groups = {eatable = 2}
|
||||
on_use = minetest.item_eat(2)
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:sushi_nigiri", 2)
|
||||
|
||||
minetest.register_craft({
|
||||
output = "ethereal:sushi_nigiri 2",
|
||||
recipe = {
|
||||
@ -484,12 +508,13 @@ minetest.register_craft({
|
||||
|
||||
-- Tamago (sushi with sweet egg)
|
||||
minetest.register_craftitem("ethereal:sushi_tamago", {
|
||||
description = S("Tamago Sushi") .. " (♥2)",
|
||||
description = S("Tamago Sushi"),
|
||||
inventory_image = "ethereal_sushi_tamago.png",
|
||||
on_use = minetest.item_eat(2),
|
||||
groups = {eatable = 2}
|
||||
on_use = minetest.item_eat(2)
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:sushi_tamago", 2)
|
||||
|
||||
minetest.register_craft({
|
||||
output = "ethereal:sushi_tamago 2",
|
||||
recipe = {
|
||||
@ -500,9 +525,8 @@ minetest.register_craft({
|
||||
|
||||
-- Fugu (prepared pufferfish)
|
||||
minetest.register_craftitem("ethereal:fugu", {
|
||||
description = S("Fugusashi") .. " (♥4)",
|
||||
description = S("Fugusashi"),
|
||||
inventory_image = "ethereal_fugu.png",
|
||||
groups = {eatable = 4},
|
||||
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
|
||||
@ -517,6 +541,8 @@ minetest.register_craftitem("ethereal:fugu", {
|
||||
end
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:fugu", 4)
|
||||
|
||||
minetest.register_craft({
|
||||
output = "ethereal:fugu",
|
||||
recipe = {
|
||||
@ -531,12 +557,13 @@ minetest.register_craft({
|
||||
|
||||
-- Teriyaki Chicken
|
||||
minetest.register_craftitem("ethereal:teriyaki_chicken", {
|
||||
description = S("Teriyaki Chicken") .. " (♥4)",
|
||||
description = S("Teriyaki Chicken"),
|
||||
inventory_image = "ethereal_teriyaki_chicken.png",
|
||||
on_use = minetest.item_eat(4),
|
||||
groups = {eatable = 4}
|
||||
on_use = minetest.item_eat(4)
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:teriyaki_chicken", 4)
|
||||
|
||||
minetest.register_craft({
|
||||
output = "ethereal:teriyaki_chicken 2",
|
||||
recipe = {
|
||||
@ -552,12 +579,13 @@ minetest.register_craft({
|
||||
|
||||
-- Teriyaki Beef
|
||||
minetest.register_craftitem("ethereal:teriyaki_beef", {
|
||||
description = S("Teriyaki Beef") .. " (♥12)",
|
||||
description = S("Teriyaki Beef"),
|
||||
inventory_image = "ethereal_teriyaki_beef.png",
|
||||
on_use = minetest.item_eat(12, "ethereal:bowl"),
|
||||
groups = {eatable = 12}
|
||||
on_use = minetest.item_eat(12, "ethereal:bowl")
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:teriyaki_beef", 12)
|
||||
|
||||
minetest.register_craft({
|
||||
output = "ethereal:teriyaki_beef",
|
||||
recipe = {
|
||||
@ -574,12 +602,14 @@ minetest.register_craft({
|
||||
|
||||
-- mushroom soup (Heals 1 heart)
|
||||
minetest.register_craftitem("ethereal:mushroom_soup", {
|
||||
description = S("Mushroom Soup") .. " (♥5)",
|
||||
description = S("Mushroom Soup"),
|
||||
inventory_image = "ethereal_mushroom_soup.png",
|
||||
groups = {drink = 1, eatable = 5},
|
||||
groups = {drink = 1},
|
||||
on_use = minetest.item_eat(5, "ethereal:bowl")
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:mushroom_soup", 5)
|
||||
|
||||
minetest.register_craft({
|
||||
output = "ethereal:mushroom_soup",
|
||||
recipe = {
|
||||
@ -592,12 +622,13 @@ minetest.register_craft({
|
||||
|
||||
-- boiled shrimp
|
||||
minetest.register_craftitem("ethereal:fish_shrimp_cooked", {
|
||||
description = S("Boiled Shrimp") .. " (♥2)",
|
||||
description = S("Boiled Shrimp"),
|
||||
inventory_image = "ethereal_fish_shrimp_cooked.png",
|
||||
on_use = minetest.item_eat(2),
|
||||
groups = {eatable = 2}
|
||||
on_use = minetest.item_eat(2)
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:fish_shrimp_cooked", 2)
|
||||
|
||||
minetest.register_craft({
|
||||
output = "ethereal:fish_shrimp_cooked 5",
|
||||
recipe = {
|
||||
@ -613,12 +644,13 @@ minetest.register_craft({
|
||||
|
||||
-- garlic butter shrimp
|
||||
minetest.register_craftitem("ethereal:garlic_shrimp", {
|
||||
description = S("Garlic Butter Shrimp") .. " (♥6)",
|
||||
description = S("Garlic Butter Shrimp"),
|
||||
inventory_image = "ethereal_garlic_butter_shrimp.png",
|
||||
on_use = minetest.item_eat(6),
|
||||
groups = {eatable = 6}
|
||||
on_use = minetest.item_eat(6)
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:garlic_shrimp", 6)
|
||||
|
||||
minetest.register_craft({
|
||||
output = "ethereal:garlic_shrimp",
|
||||
recipe = {
|
||||
@ -631,12 +663,13 @@ minetest.register_craft({
|
||||
|
||||
-- jellyfish salad
|
||||
minetest.register_craftitem("ethereal:jellyfish_salad", {
|
||||
description = S("Jellyfish Salad") .. " (♥4)",
|
||||
description = S("Jellyfish Salad"),
|
||||
inventory_image = "ethereal_jellyfish_salad.png",
|
||||
on_use = minetest.item_eat(6),
|
||||
groups = {eatable = 6}
|
||||
on_use = minetest.item_eat(6)
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:jellyfish_salad", 4)
|
||||
|
||||
minetest.register_craft({
|
||||
output = "ethereal:jellyfish_salad",
|
||||
recipe = {
|
||||
@ -653,6 +686,8 @@ minetest.register_craftitem("ethereal:calamari_raw", {
|
||||
on_use = minetest.item_eat(-2)
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:calamari_raw", -2)
|
||||
|
||||
minetest.register_craft({
|
||||
output = "ethereal:calamari_raw 2",
|
||||
recipe = {
|
||||
@ -663,12 +698,13 @@ minetest.register_craft({
|
||||
|
||||
-- cooked calamari
|
||||
minetest.register_craftitem("ethereal:calamari_cooked", {
|
||||
description = S("Calamari") .. " (♥5)",
|
||||
description = S("Calamari"),
|
||||
inventory_image = "ethereal_calamari_cooked.png",
|
||||
on_use = minetest.item_eat(5),
|
||||
groups = {eatable = 5}
|
||||
on_use = minetest.item_eat(5)
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:calamari_cooked", 5)
|
||||
|
||||
minetest.register_craft({
|
||||
output = "ethereal:calamari_cooked",
|
||||
recipe = {
|
||||
@ -679,12 +715,13 @@ minetest.register_craft({
|
||||
|
||||
-- fish & chips
|
||||
minetest.register_craftitem("ethereal:fish_n_chips", {
|
||||
description = S("Fish & Chips") .. " (♥4)",
|
||||
description = S("Fish & Chips"),
|
||||
inventory_image = "ethereal_fish_chips.png",
|
||||
on_use = minetest.item_eat(6),
|
||||
groups = {eatable = 6}
|
||||
on_use = minetest.item_eat(6)
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:fish_n_chips", 4)
|
||||
|
||||
minetest.register_craft({
|
||||
output = "ethereal:fish_n_chips",
|
||||
recipe = {
|
||||
|
23
init.lua
23
init.lua
@ -7,7 +7,7 @@
|
||||
]]
|
||||
|
||||
|
||||
ethereal = {version = "20240417"}
|
||||
ethereal = {version = "20240726"}
|
||||
|
||||
|
||||
local function setting(stype, name, default)
|
||||
@ -97,6 +97,27 @@ function ethereal.check_creative(name)
|
||||
return creative_mode_cache or minetest.check_player_privs(name, {creative = true})
|
||||
end
|
||||
|
||||
-- helper function to add {eatable} group to food items
|
||||
local mod_tt_base = minetest.get_modpath("tt_base") -- mod does similar to infotext
|
||||
|
||||
function ethereal.add_eatable(item, hp)
|
||||
|
||||
local def = minetest.registered_items[item]
|
||||
|
||||
if def then
|
||||
|
||||
local grps = def.groups or {}
|
||||
|
||||
grps.eatable = hp ; grps.flammable = 2
|
||||
|
||||
if mod_tt_base == nil then
|
||||
def.description = def.description .. " (♥" .. hp .. ")"
|
||||
end
|
||||
|
||||
minetest.override_item(item, {description = def.description, groups = grps})
|
||||
end
|
||||
end
|
||||
|
||||
if minetest.get_modpath("farming") and farming.mod and farming.mod == "redo" then
|
||||
-- farming redo already has strawberry included
|
||||
else
|
||||
|
@ -164,7 +164,7 @@ minetest.register_node("ethereal:bananaleaves", {
|
||||
|
||||
-- healing tree leaves
|
||||
minetest.register_node("ethereal:yellowleaves", {
|
||||
description = S("Healing Tree Leaves") .. " (♥1)",
|
||||
description = S("Healing Tree Leaves"),
|
||||
drawtype = leaftype,
|
||||
visual_scale = leafscale,
|
||||
tiles = {"ethereal_yellow_leaves.png"},
|
||||
|
@ -4,10 +4,10 @@ local S = ethereal.translate
|
||||
|
||||
-- wild onion
|
||||
minetest.register_craftitem("ethereal:wild_onion_plant", {
|
||||
description = S("Wild Onion") .. " (♥2)",
|
||||
description = S("Wild Onion"),
|
||||
inventory_image = "ethereal_wild_onion.png",
|
||||
wield_image = "ethereal_wild_onion.png",
|
||||
groups = {food_onion = 1, flammable = 2, eatable = 2},
|
||||
groups = {food_onion = 1},
|
||||
on_use = minetest.item_eat(2),
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
@ -15,6 +15,7 @@ minetest.register_craftitem("ethereal:wild_onion_plant", {
|
||||
end
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:wild_onion_plant", 2)
|
||||
|
||||
-- Define Onion growth stages
|
||||
local def = {
|
||||
|
@ -4,7 +4,7 @@ local S = ethereal.translate
|
||||
|
||||
-- Seaweed
|
||||
minetest.register_node("ethereal:seaweed", {
|
||||
description = S("Seaweed") .. " (♥1)",
|
||||
description = S("Seaweed"),
|
||||
drawtype = "plantlike",
|
||||
tiles = {"ethereal_seaweed.png"},
|
||||
inventory_image = "ethereal_seaweed.png",
|
||||
@ -18,7 +18,7 @@ minetest.register_node("ethereal:seaweed", {
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
|
||||
},
|
||||
post_effect_color = {a = 64, r = 100, g = 100, b = 200},
|
||||
groups = {food_seaweed = 1, snappy = 3, flammable = 3, eatable = 1},
|
||||
groups = {food_seaweed = 1, snappy = 3},
|
||||
on_use = minetest.item_eat(1),
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
|
||||
@ -58,6 +58,8 @@ minetest.register_node("ethereal:seaweed", {
|
||||
end
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:seaweed", 1)
|
||||
|
||||
minetest.register_node("ethereal:seaweed_rooted", {
|
||||
description = S("Seaweed"),
|
||||
drop = "ethereal:seaweed",
|
||||
|
@ -4,10 +4,10 @@ local S = ethereal.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",
|
||||
wield_image = "ethereal_strawberry.png",
|
||||
groups = {food_strawberry = 1, food_berry = 1, flammable = 2, eatable = 1},
|
||||
groups = {food_strawberry = 1, food_berry = 1},
|
||||
on_use = minetest.item_eat(1),
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
@ -15,6 +15,7 @@ minetest.register_craftitem("ethereal:strawberry", {
|
||||
end
|
||||
})
|
||||
|
||||
ethereal.add_eatable("ethereal:strawberry", 1)
|
||||
|
||||
-- Define Strawberry Bush growth stages
|
||||
local def = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user