Plantlife update
This commit is contained in:
parent
71285675e3
commit
2fa4fe229d
@ -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?
|
||||
|
@ -37,7 +37,9 @@ plantslib:spawn_on_surfaces({
|
||||
"default:dirt_with_grass",
|
||||
"woodsoils:dirt_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"},
|
||||
seed_diff = 545342534, -- chosen by a fair mashing of the keyboard - guaranteed to be random :P
|
||||
|
@ -123,15 +123,19 @@ end
|
||||
minetest.register_abm({
|
||||
nodenames = { "bushes:fruitless_bush" },
|
||||
interval = 500,
|
||||
chance = 10,
|
||||
chance = 5,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
|
||||
local meta = minetest.env:get_meta( pos );
|
||||
local bush_name = meta:get_string( 'bush_type' );
|
||||
if( bush_name ~= nil and bush_name ~= '' ) then
|
||||
minetest.env:set_node( pos, {type='node',name='bushes:'..bush_name..'_bush'});
|
||||
local meta = minetest.env:get_meta( pos );
|
||||
local bush_name = meta:get_string( 'bush_type' );
|
||||
if( bush_name ~= nil and bush_name ~= '' ) then
|
||||
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
|
||||
})
|
||||
|
||||
-- Define the basket and bush nodes
|
||||
|
@ -38,6 +38,7 @@ minetest.register_node("farming:seed_flax", {
|
||||
groups = {snappy=3},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
@ -86,6 +87,7 @@ minetest.register_node("farming:seed_spelt", {
|
||||
groups = {snappy=3},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
|
@ -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…
x
Reference in New Issue
Block a user