Converts Flame Grevillea and Waratah to bushes

* Added a bush group to the leaf decay function
* Retained saplings so you can still plant and grow bushes
master
vlapsley 2017-01-30 21:19:12 +11:00
parent ddb33fe7c1
commit 261974c0b5
11 changed files with 172 additions and 342 deletions

View File

@ -122,8 +122,8 @@ register_rivergrass(4)
-- Waratah
aus.register_plant({
nodes = {
trunk = "australia:waratah",
leaves = "australia:waratah",
stem = "default:acacia_bush_stem",
leaves = "australia:waratah_leaves",
air = "air",
ignore = "ignore",
},
@ -134,9 +134,9 @@ aus.register_plant({
return t.valleys > 0.3 and pos.y >= 5 and pos.y <= 35 and table.contains({"eastern_coasts"}, t.biome)
end,
grow = function(nodes, pos, data, area)
local height = math_random(2, 3)
local height = 1
local radius = math_random(1, 2)
aus.make_tree(pos, data, area, height, radius, nodes.trunk, nodes.leaves, nodes.air, nodes.ignore)
aus.make_bush(pos, data, area, height, radius, nodes.stem, nodes.leaves, nodes.air, nodes.ignore)
end,
})

View File

@ -131,6 +131,27 @@ aus.register_plant({
end,
})
-- Flame Grevillea
aus.register_plant({
nodes = {
stem = "default:acacia_bush_stem",
leaves = "australia:flame_grevillea_leaves",
air = "air",
ignore = "ignore",
},
cover = 0.0004,
density = 0.002,
priority = 35,
check = function(t, pos)
return pos.y >= 5 and pos.y <= 40 and table.contains({"jarrah_karri_forests"}, t.biome)
end,
grow = function(nodes, pos, data, area)
local height = 1
local radius = math_random(2, 3)
aus.make_bush(pos, data, area, height, radius, nodes.stem, nodes.leaves, nodes.air, nodes.ignore)
end,
})
-- Kangaroo Paw
aus.register_plant({
nodes = {"australia:kangaroo_paw"},
@ -222,27 +243,6 @@ aus.register_plant({
end,
})
-- Flame Grevillea
aus.register_plant({
nodes = {
trunk = "australia:flame_grevillea_tree",
leaves = "australia:flame_grevillea_leaves",
air = "air",
ignore = "ignore",
},
cover = 0.0004,
density = 0.002,
priority = 35,
check = function(t, pos)
return pos.y >= 5 and pos.y <= 40 and table.contains({"jarrah_karri_forests"}, t.biome)
end,
grow = function(nodes, pos, data, area)
local height = math_random(2, 3)
local radius = math_random(2, 3)
aus.make_tree(pos, data, area, height, radius, nodes.trunk, nodes.leaves, nodes.air, nodes.ignore)
end,
})
-- Jarrah
aus.register_plant({
nodes = {

View File

@ -120,6 +120,58 @@ minetest.register_node("australia:darling_lily", {
},
})
-- Flame Grevillea
minetest.register_node("australia:flame_grevillea_leaves", {
description = "Flame Grevillea Leaves",
drawtype = "allfaces_optional",
waving = 1,
tiles = {"aus_flame_grevillea_leaves.png"},
paramtype = "light",
groups = {snappy = 3, leafdecay = 3, flammable = 3, leaves = 1},
drop = {
max_items = 1,
items = {
{items = {"australia:flame_grevillea_sapling"}, rarity = 10,},
{items = {"australia:flame_grevillea_leaves"},}
}
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = default.after_place_leaves,
})
minetest.register_node("australia:flame_grevillea_sapling", {
description = "Flame Grevillea Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"default_acacia_sapling.png"},
inventory_image = "default_acacia_sapling.png",
wield_image = "default_acacia_sapling.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
on_timer = aus.grow_sapling,
selection_box = {
type = "fixed",
fixed = {-5/16, -8/16, -5/16, 5/16, 11/32, 5/16}
},
groups = {snappy = 2, dig_immediate = 2, flammable = 3, attached_node = 1, sapling = 1},
sounds = default.node_sound_leaves_defaults(),
on_construct = function(pos)
minetest.get_node_timer(pos):start(math.random(2400,4800))
end,
on_place = function(itemstack, placer, pointed_thing)
itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
"australia:flame_grevillea_sapling",
-- minp, maxp to be checked, relative to sapling pos
-- minp_relative.y = 1 because sapling pos has been checked
{x = -3, y = 1, z = -3},
{x = 3, y = 6, z = 3},
-- maximum interval of interior volume check
4)
return itemstack
end,
})
-- Kangaroo Paw
minetest.register_node("australia:kangaroo_paw", {
description = "Kangaroo Paw",
@ -385,16 +437,54 @@ minetest.register_node("australia:sturts_desert_pea", {
})
-- Waratah
minetest.register_node("australia:waratah", {
description = "Waratah",
minetest.register_node("australia:waratah_leaves", {
description = "Waratah Leaves",
drawtype = "allfaces_optional",
waving = 1,
tiles = {"aus_waratah_leaves.png"},
paramtype = "light",
groups = {snappy = 3, leafdecay = 3, flammable = 3, leaves = 1},
drop = {
max_items = 1,
items = {
{items = {"australia:waratah_sapling"}, rarity = 10,},
{items = {"australia:waratah_leaves"},}
}
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = default.after_place_leaves,
})
minetest.register_node("australia:waratah_sapling", {
description = "Waratah Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"aus_waratah.png"},
inventory_image = {"aus_waratah.png"},
wield_image = {"aus_waratah.png"},
tiles = {"default_acacia_sapling.png"},
inventory_image = "default_acacia_sapling.png",
wield_image = "default_acacia_sapling.png",
paramtype = "light",
sunlight_propagates = true,
is_ground_content = true,
groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1},
walkable = false,
on_timer = aus.grow_sapling,
selection_box = {
type = "fixed",
fixed = {-5/16, -8/16, -5/16, 5/16, 11/32, 5/16}
},
groups = {snappy = 2, dig_immediate = 2, flammable = 3, attached_node = 1, sapling = 1},
sounds = default.node_sound_leaves_defaults(),
on_construct = function(pos)
minetest.get_node_timer(pos):start(math.random(2400,4800))
end,
on_place = function(itemstack, placer, pointed_thing)
itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
"australia:waratah_sapling",
-- minp, maxp to be checked, relative to sapling pos
-- minp_relative.y = 1 because sapling pos has been checked
{x = -3, y = 1, z = -3},
{x = 3, y = 6, z = 3},
-- maximum interval of interior volume check
4)
return itemstack
end,
})

View File

@ -1040,85 +1040,6 @@ minetest.register_node("australia:fan_palm_sapling", {
end,
})
-- Flame Grevillea
minetest.register_node("australia:flame_grevillea_tree", {
description = "Flame Grevillea Tree",
tiles = {
"aus_flame_grevillea_tree_top.png",
"aus_flame_grevillea_tree_top.png",
"aus_flame_grevillea_tree.png"
},
paramtype2 = "facedir",
paramtype = "light",
drawtype = "nodebox",
is_ground_content = false,
node_box = {
type = "fixed",
fixed = {-5/32, -8/16, -5/32, 5/32, 8/16, 5/32},
},
selection_box = {
type = "fixed",
fixed = {-5/32, -8/16, -5/32, 5/32, 8/16, 5/32},
},
drop = 'default:stick 4',
groups = {tree = 1, snappy = 2, oddly_breakable_by_hand = 1, flammable = 3},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node
})
minetest.register_node("australia:flame_grevillea_leaves", {
description = "Flame Grevillea Leaves",
drawtype = "allfaces_optional",
waving = 1,
visual_scale = 1.0,
tiles = {"aus_flame_grevillea_leaves.png"},
paramtype = "light",
is_ground_content = false,
groups = {snappy = 3, leafdecay = 5, flammable = 3, leaves = 1},
drop = {
max_items = 1,
items = {
{items = {"australia:flame_grevillea_sapling"}, rarity = 20,},
{items = {"australia:flame_grevillea_leaves"},}
}
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = default.after_place_leaves,
})
minetest.register_node("australia:flame_grevillea_sapling", {
description = "Flame Grevillea Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"default_acacia_sapling.png"},
inventory_image = "default_acacia_sapling.png",
wield_image = "default_acacia_sapling.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
on_timer = aus.grow_sapling,
selection_box = {
type = "fixed",
fixed = {-5/16, -8/16, -5/16, 5/16, 11/32, 5/16}
},
groups = {snappy = 2, dig_immediate = 2, flammable = 3, attached_node = 1, sapling = 1},
sounds = default.node_sound_leaves_defaults(),
on_construct = function(pos)
minetest.get_node_timer(pos):start(math.random(2400,4800))
end,
on_place = function(itemstack, placer, pointed_thing)
itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
"australia:flame_grevillea_sapling",
-- minp, maxp to be checked, relative to sapling pos
-- minp_relative.y = 1 because sapling pos has been checked
{x = -3, y = 1, z = -3},
{x = 3, y = 6, z = 3},
-- maximum interval of interior volume check
4)
return itemstack
end,
})
-- Golden Wattle
minetest.register_node("australia:golden_wattle_tree", {
description = "Golden Wattle Tree",

View File

@ -71,7 +71,7 @@ function aus.grow_sapling(pos)
minetest.pos_to_string(pos))
aus.grow_fan_palm(pos)
elseif node.name == "australia:flame_grevillea_sapling" then
minetest.log("action", "A Flame Grevillea sapling grows into a tree at "..
minetest.log("action", "A Flame Grevillea sapling grows into a bush at "..
minetest.pos_to_string(pos))
aus.grow_flame_grevillea(pos)
elseif node.name == "australia:golden_wattle_sapling" then
@ -202,6 +202,10 @@ function aus.grow_sapling(pos)
minetest.log("action", "A Tea Tree sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_tea_tree(pos)
elseif node.name == "australia:waratah_sapling" then
minetest.log("action", "A Waratah sapling grows into a bush at "..
minetest.pos_to_string(pos))
aus.grow_waratah(pos)
elseif node.name == "australia:white_box_sapling" then
minetest.log("action", "A White Box sapling grows into a tree at "..
minetest.pos_to_string(pos))
@ -263,6 +267,7 @@ minetest.register_lbm({
"australia:swamp_paperbark_sapling",
"australia:tasmanian_myrtle_sapling",
"australia:tea_tree_sapling",
"australia:waratah_sapling",
"australia:white_box_sapling",
"australia:wirewood_sapling",
},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 731 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 682 B

View File

Before

Width:  |  Height:  |  Size: 793 B

After

Width:  |  Height:  |  Size: 793 B

View File

@ -8,230 +8,6 @@ local math_max = math.max
local math_random = math.random
local math_sqrt = math.sqrt
--[[
Grow trees from saplings
--]]
-- Sapling ABM
function aus.grow_sapling(pos)
if not default.can_grow(pos) then
-- try a bit later again
minetest.get_node_timer(pos):start(math_random(240, 600))
return
end
local node = minetest.get_node(pos)
if node.name == "australia:arnhem_cypress_pine_sapling" then
minetest.log("action", "An Arnhem Cypress Pine sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_arnhem_cypress_pine(pos)
elseif node.name == "australia:black_box_sapling" then
minetest.log("action", "A Black Box sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_black_box(pos)
elseif node.name == "australia:black_wattle_sapling" then
minetest.log("action", "A Black Wattle sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_black_wattle(pos)
elseif node.name == "australia:blue_gum_sapling" then
minetest.log("action", "A Blue Gum sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_blue_gum(pos)
elseif node.name == "australia:boab_sapling" then
minetest.log("action", "A Boab sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_boab(pos)
elseif node.name == "australia:bull_banksia_sapling" then
minetest.log("action", "A Bull Banksia sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_bull_banksia(pos)
elseif node.name == "australia:celery_top_pine_sapling" then
minetest.log("action", "A Celery-top Pine sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_celery_top_pine(pos)
elseif node.name == "australia:cherry_sapling" then
minetest.log("action", "A Cherry sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_cherry(pos)
elseif node.name == "australia:coast_banksia_sapling" then
minetest.log("action", "A Coast Banksia sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_coast_banksia(pos)
elseif node.name == "australia:coolabah_sapling" then
minetest.log("action", "A Coolabah sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_coolabah(pos)
elseif node.name == "australia:daintree_stringybark_sapling" then
minetest.log("action", "A Daintree Stringybark sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_daintree_stringybark(pos)
elseif node.name == "australia:darwin_woollybutt_sapling" then
minetest.log("action", "A Darwin Woollybutt sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_darwin_woollybutt(pos)
elseif node.name == "australia:desert_oak_sapling" then
minetest.log("action", "A Desert Oak sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_desert_oak(pos)
elseif node.name == "australia:fan_palm_sapling" then
minetest.log("action", "A Fan Palm sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_fan_palm(pos)
elseif node.name == "australia:flame_grevillea_sapling" then
minetest.log("action", "A Flame Grevillea sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_flame_grevillea(pos)
elseif node.name == "australia:golden_wattle_sapling" then
minetest.log("action", "A Golden Wattle sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_golden_wattle(pos)
elseif node.name == "australia:grey_mangrove_sapling" then
minetest.log("action", "A Grey Mangrove sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_grey_mangrove(pos)
elseif node.name == "australia:huon_pine_sapling" then
minetest.log("action", "A Huon Pine sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_huon_pine(pos)
elseif node.name == "australia:illawarra_flame_sapling" then
minetest.log("action", "A Illawarra Flame Tree sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_illawarra_flame(pos)
elseif node.name == "australia:jarrah_sapling" then
minetest.log("action", "A Jarrah sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_jarrah(pos)
elseif node.name == "australia:karri_sapling" then
minetest.log("action", "A Karri sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_karri(pos)
elseif node.name == "australia:lemon_eucalyptus_sapling" then
minetest.log("action", "A Lemon Eucalyptus sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_lemon_eucalyptus(pos)
elseif node.name == "australia:lemon_myrtle_sapling" then
minetest.log("action", "A Lemon Myrtle sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_lemon_myrtle(pos)
elseif node.name == "australia:lilly_pilly_sapling" then
minetest.log("action", "A Lilly Pilly sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_lilly_pilly(pos)
elseif node.name == "australia:macadamia_sapling" then
minetest.log("action", "A Macadamia sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_macadamia(pos)
elseif node.name == "australia:mangrove_apple_sapling" then
minetest.log("action", "A Mangrove Apple sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_mangrove_apple(pos)
elseif node.name == "australia:marri_sapling" then
minetest.log("action", "A Marri sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_marri(pos)
elseif node.name == "australia:merbau_sapling" then
minetest.log("action", "A Merbau sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_merbau(pos)
elseif node.name == "australia:moreton_bay_fig_sapling" then
minetest.log("action", "A Moreton Bay Fig sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_moreton_bay_fig(pos)
elseif node.name == "australia:mulga_sapling" then
minetest.log("action", "A Mulga sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_mulga(pos)
elseif node.name == "australia:paperbark_sapling" then
minetest.log("action", "A Paperbark sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_paperbark(pos)
elseif node.name == "australia:quandong_sapling" then
minetest.log("action", "A Quandong sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_quandong(pos)
elseif node.name == "australia:red_bottlebrush_sapling" then
minetest.log("action", "A Red Bottlebrush sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_red_bottlebrush(pos)
elseif node.name == "australia:river_oak_sapling" then
minetest.log("action", "A River Oak sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_river_oak(pos)
elseif node.name == "australia:river_red_gum_sapling" then
minetest.log("action", "A River Red Gum sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_river_red_gum(pos)
elseif node.name == "australia:rottnest_island_pine_sapling" then
minetest.log("action", "A Rottnest Island Pine sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_rottnest_island_pine(pos)
elseif node.name == "australia:scribbly_gum_sapling" then
minetest.log("action", "A Scribbly Gum sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_scribbly_gum(pos)
elseif node.name == "australia:shoestring_acacia_sapling" then
minetest.log("action", "A Shoestring Acacia sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_shoestring_acacia(pos)
elseif node.name == "australia:snow_gum_sapling" then
minetest.log("action", "A Snow Gum sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_snow_gum(pos)
elseif node.name == "australia:southern_sassafras_sapling" then
minetest.log("action", "A Southern Sassafras sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_southern_sassafras(pos)
elseif node.name == "australia:stilted_mangrove_sapling" then
minetest.log("action", "A Stilted Mangrove sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_stilted_mangrove(pos)
elseif node.name == "australia:sugar_gum_sapling" then
minetest.log("action", "A Sugar Gum sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_sugar_gum(pos)
elseif node.name == "australia:swamp_bloodwood_sapling" then
minetest.log("action", "A Swamp Bloodwood sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_swamp_bloodwood(pos)
elseif node.name == "australia:swamp_gum_sapling" then
minetest.log("action", "A Swamp Gum sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_swamp_gum(pos)
elseif node.name == "australia:swamp_paperbark_sapling" then
minetest.log("action", "A Swamp Paperbark sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_swamp_paperbark(pos)
elseif node.name == "australia:tasmanian_myrtle_sapling" then
minetest.log("action", "A Tasmanian Myrtle sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_tasmanian_myrtle(pos)
elseif node.name == "australia:tea_tree_sapling" then
minetest.log("action", "A Tea Tree sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_tea_tree(pos)
elseif node.name == "australia:white_box_sapling" then
minetest.log("action", "A White Box sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_white_box(pos)
elseif node.name == "australia:wirewood_sapling" then
minetest.log("action", "A Wirewood sapling grows into a tree at "..
minetest.pos_to_string(pos))
aus.grow_wirewood(pos)
end
end
minetest.register_lbm({
name = "australia:saplings_node_timer",
nodenames = {
"group:sapling"
},
action = function(pos)
minetest.get_node_timer(pos):start(math_random(1200, 2400))
end
})
-- Make a tree trunk 2-nodes wide.
local function make_treetrunk2(x0, y0, z0, data, area, height, trunk, air, base)
local ystride = area.ystride
@ -282,6 +58,21 @@ local function make_treetrunk3(x0, y0, z0, data, area, height, trunk, air, base)
end
end
-- Generic bush function.
function aus.make_bush(pos, data, area, height, radius, stem, leaves, air,
ignore)
local ystride = area.ystride -- Useful to get the index above
local iv = area:indexp(pos)
for i = 1, height do -- Build the trunk
data[iv] = stem
iv = iv + ystride -- increment by one node up
end
local np = {offset = 0.8, scale = 0.4, spread = {x = 8, y = 4, z = 8}, octaves = 3, persist = 0.5}
pos.y = pos.y + height
aus.make_leavesblob(pos, data, area, stem, leaves, air, ignore,
{x = radius, y = radius, z = radius}, np)
end
-- Generic tree function.
function aus.make_tree(pos, data, area, height, radius, trunk, leaves, air,
ignore, limbs, fruit_chance, fruit)
@ -1037,10 +828,10 @@ end
-- Flame Grevillea
function aus.grow_flame_grevillea(pos)
-- individual parameters
local height = math_random(2, 3)
local height = 1
local radius = math_random(2, 3)
-- voxelmanip stuff
local trunk = minetest.get_content_id("australia:flame_grevillea_tree")
local stem = minetest.get_content_id("default:acacia_bush_stem")
local leaves = minetest.get_content_id("australia:flame_grevillea_leaves")
local air = minetest.get_content_id("air")
local ignore = minetest.get_content_id("ignore")
@ -1051,7 +842,7 @@ function aus.grow_flame_grevillea(pos)
)
local area = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
local data = vm:get_data()
aus.make_tree(pos, data, area, height, radius, trunk, leaves, air, ignore)
aus.make_bush(pos, data, area, height, radius, stem, leaves, air, ignore)
vm:set_data(data)
vm:write_to_map()
vm:update_map()
@ -1820,6 +1611,29 @@ function aus.grow_tea_tree(pos)
vm:update_map()
end
-- Waratah
function aus.grow_waratah(pos)
-- individual parameters
local height = 1
local radius = math_random(1, 2)
-- voxelmanip stuff
local stem = minetest.get_content_id("default:acacia_bush_stem")
local leaves = minetest.get_content_id("australia:waratah_leaves")
local air = minetest.get_content_id("air")
local ignore = minetest.get_content_id("ignore")
local vm = minetest.get_voxel_manip()
local minp, maxp = vm:read_from_map(
{x = pos.x - 2, y = pos.y, z = pos.z - 2},
{x = pos.x + 2, y = pos.y + height + 2, z = pos.z + 2}
)
local area = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
local data = vm:get_data()
aus.make_bush(pos, data, area, height, radius, stem, leaves, air, ignore)
vm:set_data(data)
vm:write_to_map()
vm:update_map()
end
-- White Box
function aus.grow_white_box(pos)
-- individual parameters

View File

@ -340,7 +340,7 @@ minetest.register_abm({
local rad = minetest.registered_nodes[node.name].groups.leafdecay
-- Assume ignore is a trunk, to make this
-- work at the border of a loaded area
if minetest.find_node_near(pos, rad, {"ignore", "group:tree"}) then
if minetest.find_node_near(pos, rad, {"ignore", "group:tree", "group:bush"}) then
return
end
-- Drop stuff

View File

@ -1228,7 +1228,7 @@ minetest.register_node("default:bush_stem", {
wield_image = "default_bush_stem.png",
paramtype = "light",
sunlight_propagates = true,
groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, bush = 1},
sounds = default.node_sound_wood_defaults(),
selection_box = {
type = "fixed",
@ -1255,7 +1255,7 @@ minetest.register_node("default:acacia_bush_stem", {
wield_image = "default_acacia_bush_stem.png",
paramtype = "light",
sunlight_propagates = true,
groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, bush = 1},
sounds = default.node_sound_wood_defaults(),
selection_box = {
type = "fixed",