Growing trees from this mod does not fire `TreeGrowthEvent`, preventing MI/EI farmer from harvesting them
James103 opened this issue ยท 7 comments
When growing trees from this mod, the TreeGrowthEvent event is not fired, unlike when vanilla trees grow. This prevents things like Extended Industrialization's Farmer multiblock from detecting the tree growth and makes it unable to harvest trees from this mod.
To reproduce:
- Setup a large Electric Farmer, power it, and make sure it has enough output space.
- Plant some vanilla saplings and bonemeal them. The resulting trees are harvested automatically.
- Plant some saplings from this mod and bonemeal them. The resulting trees are not harvested automatically.
Version info:
- Minecraft 1.21.1
- NeoForge 21.1.77
- Oh The Biomes We've Gone 2.2.3
- Oh The Trees You'll Grow 5.0.3
- Modern Industrialization 2.2.25
- Extended Industrialization 1.9.4-beta-1.21.1
- Modpack: Craftoria 1.8.0
Yes it is different from BlockGrowFeatureEvent. This isn't an issue on your end really
I just tested with a more minimal set of mods and a more minimal setup; Aspen trees still didn't get cut down by the EI farmer, while Birch trees were, even though ample output space was provided for both trees. This may be a bug in Extended Industrialization.
Minimal mod list:
Cloth Config v15 API 15.0.140 (cloth_config)
CorgiLib 5.0.0.2 (corgilib)
Extended Industrialization 1.9.4-beta-1.21.1 (extended_industrialization)
GeckoLib 4 4.7 (geckolib)
Grand Power 3.0.0 (grandpower)
Minecraft 1.21.1 (minecraft)
Modern Industrialization 2.2.25 (modern_industrialization)
NeoForge 21.1.80 (neoforge)
No Chat Reports 1.21.1-v2.9.1 (nochatreports)
Oh The Biomes We've Gone 2.2.5 (biomeswevegone)
Oh The Trees You'll Grow 5.0.3 (ohthetreesyoullgrow)
Patchouli 1.21-87-NEOFORGE-SNAPSHOT (patchouli)
TerraBlender 4.1.0.5 (terrablender)
Tesseract API 1.5.4-beta-1.21.1 (tesseract_api)
The TreeGrowthEvent is a custom event I made to detect specifically when a TreeFeature is placed and to also contain all of the placed blocks from TreeFeature#place so I don't have to spend resources scanning for all the blocks of the tree, where that is not possible with BlockGrowFeatureEvent. From what I can tell, OTYG does not use TreeFeature (see here) so that would be why this doesn't work.
Started working on a solution to this and it seems like the leavePositions and trunkPositions in the TreeFromStructureNBTFeature#place method do not contain all of the blocks placed. These variables are similar to the ones in vanilla's TreeFeature#place method, which does capture all of the placed blocks.
From briefly looking at the source for your tree feature, it looks like placeAdditional(...) (here) and fillLogsUnder(...) (here) both do not add to any block position sets.
To maybe make the issue a bit clearer, here's a couple screenshots showing what blocks aren't being captured by these sets (on the left) next to all the blocks placed (on the right). I'm using the Pine tree as an example here.

Here's another example using the Araucaria tree.

