forked from mtcontrib/plantlife_modpack
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,18 +36,28 @@ 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),
|
||||
})
|
||||
|
||||
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" },
|
||||
{ "bushes:"..berry, "bushes:"..berry, "bushes:"..berry },
|
||||
{ "group:"..berry, "group:"..berry, "group:"..berry },
|
||||
},
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
-- Cooked pie
|
||||
|
||||
@ -90,14 +100,25 @@ for i, berry in ipairs(bushes_classic.bushes) do
|
||||
})
|
||||
end
|
||||
|
||||
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:strawberry_pie_raw 1",
|
||||
output = "bushes:mixed_berry_pie_raw 2",
|
||||
recipe = {
|
||||
{ "bushes:sugar", "group:junglegrass", "bushes:sugar" },
|
||||
{ "farming_plus:strawberry_item", "farming_plus:strawberry_item", "farming_plus:strawberry_item" },
|
||||
{ "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 = {
|
||||
@ -106,3 +127,5 @@ minetest.register_craft({
|
||||
{ "group:berry", "group:berry", "group:berry" },
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
|
@ -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