If there are some observers face to logs, and tree grow near it, the observer can be triggered.
step to reproduce:
1. build it:
[media]2. bonemeal the sapling
3. notice the observer is triggered
[media]expected behaviour: the tree growth should not trigger the observer, as no block is changed in front of it.
I have tested jungle, oak, acacia and spruce sapling, and they are affected, too.
Attachments
Comments 5
I highly doubt this is intentional. The behavior was introduced in 1.20, and it breaks a number of automatic tree farms, mostly simpler designs since they tend to use observers closer to the core. Thanks to Lollopollq, we've identified the problematic bit of code. As they put it:
The behavior arises from the fact that
TreeFeature#updateLeaves(LevelAccessor, BoundingBox, Set, Set, Set)
will add log positions to theBitSetDiscreteVoxelShape
used to then send shape updates around it
So any time a tree's canopy grows large enough that its leaves would grow in spots taken by pre-existing logs which are being observed, the observers will get extraneous updates. Generally in tree farms the purpose of these observers is to watch for movement when the core pushes a tree out, powering more pistons to move the logs further from the core. When they fire early due to this new 1.20 behavior, it is likely that they block the log movement instead, bricking the farm.
This "Logstone" mechanic is very unintuitive. It only works in 1.20+ and on overworld trees only. Mojang Changed the code responsible for "leafstone": Leaves previously had a tag for their distance to a log that started at 1 and went up to 5 or something. But in 1.20, the leaves distance tag was altered and made logs part of that tag, where logs are now given the distance tag and it's set to 0. When a tree grows and its bounding box interferes with another pre placed log, the tag is kinda reset or something, and that creates a shape update, which lets observers see a change on logs despite the fact they haven't changed visually. At least, That's what I've been told by a guy who said they read the code, and the theory works with in game practice, so I assume it is correct. (To my understanding, the shape update is due to a change in the distance tag on the log. I can't read code.)
Personally, I would like this mechanic to stay, BUT TO BE CONSISTENT WITH NETHER TREES. Currently, nether trees adhere to the current "leafstone" mechanic where nether tree stems interact with leaves just the same as overworld trees, but they don't change their log distance tag to cause a shape update when a nether tree is grown within the required tree bounding box. I would like nether trees to adopt this mechanic, if it is deemed to be a voluntary game mechanic (For the sake of consistence and parity).
If the mechanic is deemed to indeed be a bug and get fixed, pre-placed logs shouldn't create a shape update when a tree is grown next to them.
Can confirm in 23w03b. Though, while there is no obvious source visible in game for the block updates (no tags changed for the log blocks) this is very likely intentional as leaves and logs work in tandom together to handle decay behavior. The cause is likely because the leaf blocks update the logs (even if they are not from the 'source' tree), and vice-versa.