mirror of
https://github.com/mt-mods/plantlife_modpack.git
synced 2024-11-11 12:50:23 +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, {
|
||||
description = desc,
|
||||
inventory_image = "bushes_"..berry..".png",
|
||||
groups = {berry = 1},
|
||||
groups = {berry = 1, [berry] = 1},
|
||||
on_use = minetest.item_eat(1),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "bushes:"..berry.."_pie_raw 1",
|
||||
recipe = {
|
||||
{ "bushes:sugar", "group:junglegrass", "bushes:sugar" },
|
||||
{ "bushes:"..berry, "bushes:"..berry, "bushes:"..berry },
|
||||
},
|
||||
})
|
||||
if minetest.registered_nodes["farming:soil"] then
|
||||
minetest.register_craft({
|
||||
output = "bushes:"..berry.."_pie_raw 1",
|
||||
recipe = {
|
||||
{ "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
|
||||
|
||||
-- Cooked pie
|
||||
|
@ -90,19 +100,32 @@ for i, berry in ipairs(bushes_classic.bushes) do
|
|||
})
|
||||
end
|
||||
|
||||
minetest.register_craft({
|
||||
output = "bushes:strawberry_pie_raw 1",
|
||||
recipe = {
|
||||
{ "bushes:sugar", "group:junglegrass", "bushes:sugar" },
|
||||
{ "farming_plus:strawberry_item", "farming_plus:strawberry_item", "farming_plus:strawberry_item" },
|
||||
},
|
||||
})
|
||||
if minetest.registered_nodes["farming_plus:strawberry"] then
|
||||
minetest.register_craftitem(":farming_plus:strawberry_item", {
|
||||
description = "Strawberry",
|
||||
inventory_image = "farming_strawberry.png",
|
||||
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
|
||||
farming_plus?
|
||||
|
|
|
@ -14,15 +14,6 @@ local grasses_list = {
|
|||
{"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
|
||||
minetest.register_node(":default:junglegrass", {
|
||||
description = "Jungle Grass",
|
||||
|
@ -43,7 +34,7 @@ if not minetest.registered_nodes["default:junglegrass"] then
|
|||
},
|
||||
})
|
||||
else
|
||||
new_junglegrass=clone_node("default:junglegrass")
|
||||
new_junglegrass=plantslib:clone_node("default:junglegrass")
|
||||
new_junglegrass.groups.junglegrass = 1
|
||||
minetest.register_node(":default:junglegrass", new_junglegrass)
|
||||
end
|
||||
|
|
|
@ -59,6 +59,15 @@ function plantslib:is_node_loaded(node_pos)
|
|||
return true
|
||||
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)
|
||||
if DEBUG then
|
||||
print("[Plantlife] "..msg)
|
||||
|
|
Loading…
Reference in New Issue
Block a user