saplings are allowed to grow trees despite not having free space above #602
Labels
No Label
#P1 CRITICAL
#P2: HIGH
#P3: elevated
#P4 priority: medium
#P6: low
#Review
annoying
API
bug
code quality
combat
commands
compatibility
configurability
contribution inside
controls
core feature
creative mode
delayed for engine release
documentation
duplicate
enhancement
environment
gameplay
graphics
ground content conflict
GUI/HUD
help wanted
incomplete feature
invalid / won't fix
items
looking for contributor
mapgen
meta
mineclone2+
Minecraft >= 1.13
Minecraft >= 1.17
missing feature
mobile
mobs
mod support
model needed
multiplayer
Needs adoption
needs discussion
needs engine change
needs more information
needs research
nodes
non-Minecraft feature
non-mob entities
performance
player
possible close
redstone
release notes
schematics
Skyblock
sounds
Testing / Retest
tools
translation
unconfirmed
mcl5
mcla
Media missing
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: VoxeLibre/VoxeLibre#602
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
saplings will grow to trees even if not enought free space is available above them and where the trunk grows any pre-existing block is replaced with its wood
I looked into the code and it appears that the trees are placed as schematics. I looked into the format for schematic and see that there is a bit for each node which means that it will force placement. I assume the reason tree trunks replace blocks is because this bit is set to one for tree trucks.
I see three ways to solve it:
This solves the problem where trees remove block in the world. I think that would mean that the tree will grow through blocks instead. I'm not 100% familiar with schamtics though so I dont fully know if this is the case.
I think this would make more sense because then sapling never grows up if it does not have the space. Then I can use sapling for decoration in house again.
This might make it possible to generate trees which grow up until it hits a wall.
I don't know how minecraft deals with this.
Looks like saplings do not grow at all in Minecraft if there is no space above them
https://minecraft.gamepedia.com/Sapling
Maybe these checks can be added to Lua?
Do note that Minecraft trees ignore, but will not replace dirt, which is the most common block to expect to cause problems in tree growth. There would need to be an option to only replace certain kinds of blocks (in this case, logs and leaves).
Setting elevated priority because this can be used to destroy bedrock.
I have created a fix for this. It is on this branch:
https://git.minetest.land/ryvnf/MineClone2/src/branch/treecheck
It will check a volume around the tree for blocks which would prevent the tree from growing. The values are not the same as the ones listed in the Minecraft wiki because the trees appear to have different sizes in MineClone 2. I measured the maximum size of each tree and set the values so that tree branches/trunks should not generate outside of the checked volume. The leaves do not overwrite other nodes so it is possible for some leaves to generate outside of the checked volume.
Torches, plants, wood, trees, leaves and dirt do not affect tree growth.
Jungle and spruce saplings in 2x2 formations will grow into normal trees if there is no room for a huge tree. Balloon oak trees have separate checks than normal oaks trees (because they are much larger). If there is no room for a ballon oak tree to grow, but still room for a normal oak tree to grow, a normal oak tree is grown.
I have merged the fix to the master branch.
Awesome!
I your commit I noticed some variables and function names that should be local but were declared global. Please, in future make sure to use the keyword
local
whenever possible, use global variables very sparingly.