Plantlife update
This commit is contained in:
parent
71285675e3
commit
2fa4fe229d
@ -36,18 +36,28 @@ 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),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
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({
|
minetest.register_craft({
|
||||||
output = "bushes:"..berry.."_pie_raw 1",
|
output = "bushes:"..berry.."_pie_raw 1",
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "bushes:sugar", "group:junglegrass", "bushes:sugar" },
|
{ "bushes:sugar", "group:junglegrass", "bushes:sugar" },
|
||||||
{ "bushes:"..berry, "bushes:"..berry, "bushes:"..berry },
|
{ "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
|
||||||
|
|
||||||
minetest.register_craft({
|
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",
|
output = "bushes:mixed_berry_pie_raw 2",
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "bushes:sugar", "group:junglegrass", "bushes:sugar" },
|
{ "bushes:sugar", "group:junglegrass", "bushes:sugar" },
|
||||||
{ "group:berry", "group:berry", "group:berry" },
|
{ "group:berry", "group:berry", "group:berry" },
|
||||||
{ "group:berry", "group:berry", "group:berry" },
|
{ "group:berry", "group:berry", "group:berry" },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
@ -1 +1,2 @@
|
|||||||
plants_lib
|
plants_lib
|
||||||
|
farming_plus?
|
||||||
|
@ -37,7 +37,9 @@ plantslib:spawn_on_surfaces({
|
|||||||
"default:dirt_with_grass",
|
"default:dirt_with_grass",
|
||||||
"woodsoils:dirt_with_leaves_1",
|
"woodsoils:dirt_with_leaves_1",
|
||||||
"woodsoils:grass_with_leaves_1",
|
"woodsoils:grass_with_leaves_1",
|
||||||
"woodsoils:grass_with_leaves_2"
|
"woodsoils:grass_with_leaves_2",
|
||||||
|
"farming:soil",
|
||||||
|
"farming:soil_wet"
|
||||||
},
|
},
|
||||||
avoid_nodes = {"group:bush"},
|
avoid_nodes = {"group:bush"},
|
||||||
seed_diff = 545342534, -- chosen by a fair mashing of the keyboard - guaranteed to be random :P
|
seed_diff = 545342534, -- chosen by a fair mashing of the keyboard - guaranteed to be random :P
|
||||||
|
@ -123,13 +123,17 @@ end
|
|||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
nodenames = { "bushes:fruitless_bush" },
|
nodenames = { "bushes:fruitless_bush" },
|
||||||
interval = 500,
|
interval = 500,
|
||||||
chance = 10,
|
chance = 5,
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
|
|
||||||
local meta = minetest.env:get_meta( pos );
|
local meta = minetest.env:get_meta( pos );
|
||||||
local bush_name = meta:get_string( 'bush_type' );
|
local bush_name = meta:get_string( 'bush_type' );
|
||||||
if( bush_name ~= nil and bush_name ~= '' ) then
|
if( bush_name ~= nil and bush_name ~= '' ) then
|
||||||
minetest.env:set_node( pos, {type='node',name='bushes:'..bush_name..'_bush'});
|
local dirtpos = { x = pos.x, y = pos.y-1, z = pos.z }
|
||||||
|
local dirt = minetest.get_node(dirtpos)
|
||||||
|
if dirt.name == "farming:soil_wet" or math.random(1,3) == 1 then
|
||||||
|
minetest.env:set_node( pos, {type='node',name='bushes:'..bush_name..'_bush'})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
@ -38,6 +38,7 @@ minetest.register_node("farming:seed_flax", {
|
|||||||
groups = {snappy=3},
|
groups = {snappy=3},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
|
walkable = false,
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
@ -86,6 +87,7 @@ minetest.register_node("farming:seed_spelt", {
|
|||||||
groups = {snappy=3},
|
groups = {snappy=3},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
|
walkable = false,
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
|
@ -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…
x
Reference in New Issue
Block a user