diff --git a/bushes_classic/init.lua b/bushes_classic/init.lua index b19d539..81e2776 100644 --- a/bushes_classic/init.lua +++ b/bushes_classic/init.lua @@ -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 diff --git a/bushes_classic/nodes.lua b/bushes_classic/nodes.lua index 03ef3fc..d34dc10 100644 --- a/bushes_classic/nodes.lua +++ b/bushes_classic/nodes.lua @@ -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