All tree leaves have distance of 1 when generated
hammertater opened this issue ยท 2 comments
As of version 1.16.4-2.0.1, when a tree in this mod is generated, all leaves have their DISTANCE
property set to 1. The distances only corrects themselves when a nearby leaves block is broken.
Looks like your MapleTreeFeature
class is extending directly from Feature<BaseTreeFeatureConfig>
:
Minecraft's net.minecraft.world.gen.feature.TreeFeature
already handles updating leaves distances at generation time, so y'all might consider extending that class instead? Biomes O Plenty uses it pretty painlessly* (see https://github.com/Glitchfiend/BiomesOPlenty/blob/02157af333cf7b917746cc6e6d966fc58a2b67f5/src/main/java/biomesoplenty/common/world/gen/feature/tree/TreeFeatureBase.java#L191; if the changedLogs
and changedLeaves
sets are populated with the generated logs and leaves blocks, then leaves distances will automatically be updated by TreeFeature
code).
Edit: *BOP makes it look easy by using custom mappings and forcing functions to be public... maybe the TreeFeature class comes with too much baggage, but at least it's something to reference
Why I care -- my TreeChop mod uses the leaves DISTANCE
property to decide which tree each leaves block belongs to. The mod allows a whole tree to be broken at once, also breaking any leaves that "belong" to it. When two Autumnity trees are next to each other but their leaves have the wrong distance values, I can't tell which leaves belong to which tree.
I know it's a tiny, tiny thing, but fixing this would be very much appreciated.