Potion-Studios / Oh-The-Biomes-Weve-Gone

Sequel to Oh The Biomes You'll Go, this mod adds a variety of new biomes to minecraft
https://www.curseforge.com/minecraft/mc-mods/oh-the-biomes-weve-gone
Other
31 stars 9 forks source link

Growing trees from this mod does not fire `TreeGrowthEvent`, preventing MI/EI farmer from harvesting them #171

Open James103 opened 5 days ago

James103 commented 5 days ago

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:

  1. Setup a large Electric Farmer, power it, and make sure it has enough output space.
  2. Plant some vanilla saplings and bonemeal them. The resulting trees are harvested automatically.
  3. Plant some saplings from this mod and bonemeal them. The resulting trees are not harvested automatically.

Version info:

JT122406 commented 5 days ago

Looking into the code base it would have to be fired since we extend the vanilla treegrower and don't override the growTree method where the event is called in NeoForge and Forge. image

James103 commented 4 days ago

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) 
Swedz commented 4 days ago

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.

JT122406 commented 4 days ago

So this is a custom event from your mod?

Swedz commented 4 days ago

Yes it is different from BlockGrowFeatureEvent. This isn't an issue on your end really