mirror of
https://github.com/mt-mods/plantlife_modpack.git
synced 2024-11-11 21:00:22 +01:00
multiple changes
Make bushes use default farming mod's flour for making pies instead of jungle grass, if that mod is installed. Junglegrass will be used if farming is not present. Make bushes mod support farming_plus more completely - either its or bushes' strawberries may be used to make a strawberry pie or a mixed fruit pie - mix and match the two types of strawberries as desired. move clone node function from junglegrass mod to plants_lib so that other mods can use it.
This commit is contained in:
parent
f6ffe4bbff
commit
94e21c0cf6
|
@ -36,17 +36,27 @@ for i, berry in ipairs(bushes_classic.bushes) do
|
||||||
minetest.register_craftitem(":bushes:"..berry, {
|
minetest.register_craftitem(":bushes:"..berry, {
|
||||||
description = desc,
|
description = desc,
|
||||||
inventory_image = "bushes_"..berry..".png",
|
inventory_image = "bushes_"..berry..".png",
|
||||||
groups = {berry = 1},
|
groups = {berry = 1, [berry] = 1},
|
||||||
on_use = minetest.item_eat(1),
|
on_use = minetest.item_eat(1),
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
if minetest.registered_nodes["farming:soil"] then
|
||||||
output = "bushes:"..berry.."_pie_raw 1",
|
minetest.register_craft({
|
||||||
recipe = {
|
output = "bushes:"..berry.."_pie_raw 1",
|
||||||
{ "bushes:sugar", "group:junglegrass", "bushes:sugar" },
|
recipe = {
|
||||||
{ "bushes:"..berry, "bushes:"..berry, "bushes:"..berry },
|
{ "bushes:sugar", "farming:flour", "bushes:sugar" },
|
||||||
},
|
{ "group:"..berry, "group:"..berry, "group:"..berry },
|
||||||
})
|
},
|
||||||
|
})
|
||||||
|
else
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "bushes:"..berry.."_pie_raw 1",
|
||||||
|
recipe = {
|
||||||
|
{ "bushes:sugar", "group:junglegrass", "bushes:sugar" },
|
||||||
|
{ "group:"..berry, "group:"..berry, "group:"..berry },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Cooked pie
|
-- Cooked pie
|
||||||
|
@ -90,19 +100,32 @@ for i, berry in ipairs(bushes_classic.bushes) do
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_craft({
|
if minetest.registered_nodes["farming_plus:strawberry"] then
|
||||||
output = "bushes:strawberry_pie_raw 1",
|
minetest.register_craftitem(":farming_plus:strawberry_item", {
|
||||||
recipe = {
|
description = "Strawberry",
|
||||||
{ "bushes:sugar", "group:junglegrass", "bushes:sugar" },
|
inventory_image = "farming_strawberry.png",
|
||||||
{ "farming_plus:strawberry_item", "farming_plus:strawberry_item", "farming_plus:strawberry_item" },
|
on_use = minetest.item_eat(2),
|
||||||
},
|
groups = {berry=1, strawberry=1}
|
||||||
})
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
if minetest.registered_nodes["farming:soil"] then
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "bushes:mixed_berry_pie_raw 2",
|
||||||
|
recipe = {
|
||||||
|
{ "bushes:sugar", "farming:flour", "bushes:sugar" },
|
||||||
|
{ "group:berry", "group:berry", "group:berry" },
|
||||||
|
{ "group:berry", "group:berry", "group:berry" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
else
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "bushes:mixed_berry_pie_raw 2",
|
||||||
|
recipe = {
|
||||||
|
{ "bushes:sugar", "group:junglegrass", "bushes:sugar" },
|
||||||
|
{ "group:berry", "group:berry", "group:berry" },
|
||||||
|
{ "group:berry", "group:berry", "group:berry" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
output = "bushes:mixed_berry_pie_raw 2",
|
|
||||||
recipe = {
|
|
||||||
{ "bushes:sugar", "group:junglegrass", "bushes:sugar" },
|
|
||||||
{ "group:berry", "group:berry", "group:berry" },
|
|
||||||
{ "group:berry", "group:berry", "group:berry" },
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
plants_lib
|
plants_lib
|
||||||
|
farming_plus?
|
||||||
|
|
|
@ -14,15 +14,6 @@ local grasses_list = {
|
||||||
{"default:junglegrass" , nil}
|
{"default:junglegrass" , nil}
|
||||||
}
|
}
|
||||||
|
|
||||||
function clone_node(name)
|
|
||||||
node2={}
|
|
||||||
node=minetest.registered_nodes[name]
|
|
||||||
for k,v in pairs(node) do
|
|
||||||
node2[k]=v
|
|
||||||
end
|
|
||||||
return node2
|
|
||||||
end
|
|
||||||
|
|
||||||
if not minetest.registered_nodes["default:junglegrass"] then
|
if not minetest.registered_nodes["default:junglegrass"] then
|
||||||
minetest.register_node(":default:junglegrass", {
|
minetest.register_node(":default:junglegrass", {
|
||||||
description = "Jungle Grass",
|
description = "Jungle Grass",
|
||||||
|
@ -43,7 +34,7 @@ if not minetest.registered_nodes["default:junglegrass"] then
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
new_junglegrass=clone_node("default:junglegrass")
|
new_junglegrass=plantslib:clone_node("default:junglegrass")
|
||||||
new_junglegrass.groups.junglegrass = 1
|
new_junglegrass.groups.junglegrass = 1
|
||||||
minetest.register_node(":default:junglegrass", new_junglegrass)
|
minetest.register_node(":default:junglegrass", new_junglegrass)
|
||||||
end
|
end
|
||||||
|
|
|
@ -59,6 +59,15 @@ function plantslib:is_node_loaded(node_pos)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function plantslib:clone_node(name)
|
||||||
|
node2={}
|
||||||
|
node=minetest.registered_nodes[name]
|
||||||
|
for k,v in pairs(node) do
|
||||||
|
node2[k]=v
|
||||||
|
end
|
||||||
|
return node2
|
||||||
|
end
|
||||||
|
|
||||||
function plantslib:dbg(msg)
|
function plantslib:dbg(msg)
|
||||||
if DEBUG then
|
if DEBUG then
|
||||||
print("[Plantlife] "..msg)
|
print("[Plantlife] "..msg)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user