Add large cactus seedling

Alter 'large cactus' schematic to place another force-placed cactus node,
to replace the cactus seedling on growth.
Make schematic 5x7x5 to solve rotation, placement and protection check
issues.
Add a y-slice probability for height variation.

Growth time is tuned to not make this a faster way to obtain cactus nodes
compared to normal cactus farming.
Seedling texture by Extex101.

Use sapling/seedling description in protection intersection message in
'sapling_on_place' function.
This commit is contained in:
Paramat 2019-01-02 02:18:50 +00:00 committed by GitHub
parent da10af919e
commit 6688ddf6d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 143 additions and 4 deletions

View file

@ -510,6 +510,16 @@ function default.grow_pine_bush(pos)
end
-- Large cactus
function default.grow_large_cactus(pos)
local path = minetest.get_modpath("default") ..
"/schematics/large_cactus.mts"
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
path, "random", nil, false)
end
--
-- Sapling 'on place' function to check protection of node and resulting tree volume
--
@ -550,7 +560,9 @@ function default.sapling_on_place(itemstack, placer, pointed_thing,
interval) then
minetest.record_protection_violation(pos, player_name)
-- Print extra information to explain
minetest.chat_send_player(player_name, "Tree will intersect protection")
minetest.chat_send_player(player_name,
itemstack:get_definition().description .. " will intersect protection " ..
"on growth")
return itemstack
end