mirror of
https://github.com/mt-mods/plantlife_modpack.git
synced 2024-12-25 01:50:20 +01:00
Made bushes also spawn on wet or dry farming soil
(at the same rates as anywhere else) Slowed down overall berry regrowth and at the same time make it so that if a bush is planted on wet farming soil, it will re-grow its berries faster, provided the soil remains wet. On average, a wild bush will regrow its berries 50% slower than before, while a farmed bush will regrow its berries twice as fast as the wild ones did before (about 3x faster than wild ones do now).
This commit is contained in:
parent
94e21c0cf6
commit
7931470ddb
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user