--- a/net/minecraft/world/level/block/grower/WorldGenTreeProvider.java
+++ b/net/minecraft/world/level/block/grower/WorldGenTreeProvider.java
@@ -25,6 +25,12 @@
 import net.minecraft.world.level.chunk.ChunkGenerator;
 import net.minecraft.world.level.levelgen.feature.WorldGenFeatureConfigured;
 
+// CraftBukkit start
+import net.minecraft.data.worldgen.features.TreeFeatures;
+import net.minecraft.world.level.block.BlockSapling;
+import org.bukkit.TreeType;
+// CraftBukkit end
+
 public final class WorldGenTreeProvider {
 
     private static final Map<String, WorldGenTreeProvider> GROWERS = new Object2ObjectArrayMap();
@@ -75,21 +81,22 @@
             }
         }
 
-        return flag && this.flowers.isPresent() ? (ResourceKey) this.flowers.get() : (ResourceKey) this.tree.orElse((Object) null);
+        return flag && this.flowers.isPresent() ? (ResourceKey) this.flowers.get() : (ResourceKey) this.tree.orElse(null); // CraftBukkit - decompile error
     }
 
     @Nullable
     private ResourceKey<WorldGenFeatureConfigured<?, ?>> getConfiguredMegaFeature(RandomSource randomsource) {
-        return this.secondaryMegaTree.isPresent() && randomsource.nextFloat() < this.secondaryChance ? (ResourceKey) this.secondaryMegaTree.get() : (ResourceKey) this.megaTree.orElse((Object) null);
+        return this.secondaryMegaTree.isPresent() && randomsource.nextFloat() < this.secondaryChance ? (ResourceKey) this.secondaryMegaTree.get() : (ResourceKey) this.megaTree.orElse(null); // CraftBukkit - decompile error
     }
 
     public boolean growTree(WorldServer worldserver, ChunkGenerator chunkgenerator, BlockPosition blockposition, IBlockData iblockdata, RandomSource randomsource) {
         ResourceKey<WorldGenFeatureConfigured<?, ?>> resourcekey = this.getConfiguredMegaFeature(randomsource);
 
         if (resourcekey != null) {
-            Holder<WorldGenFeatureConfigured<?, ?>> holder = (Holder) worldserver.registryAccess().registryOrThrow(Registries.CONFIGURED_FEATURE).getHolder(resourcekey).orElse((Object) null);
+            Holder<WorldGenFeatureConfigured<?, ?>> holder = (Holder) worldserver.registryAccess().registryOrThrow(Registries.CONFIGURED_FEATURE).getHolder(resourcekey).orElse(null); // CraftBukkit - decompile error
 
             if (holder != null) {
+                setTreeType(holder); // CraftBukkit
                 for (int i = 0; i >= -1; --i) {
                     for (int j = 0; j >= -1; --j) {
                         if (isTwoByTwoSapling(iblockdata, worldserver, blockposition, i, j)) {
@@ -120,11 +127,12 @@
         if (resourcekey1 == null) {
             return false;
         } else {
-            Holder<WorldGenFeatureConfigured<?, ?>> holder1 = (Holder) worldserver.registryAccess().registryOrThrow(Registries.CONFIGURED_FEATURE).getHolder(resourcekey1).orElse((Object) null);
+            Holder<WorldGenFeatureConfigured<?, ?>> holder1 = (Holder) worldserver.registryAccess().registryOrThrow(Registries.CONFIGURED_FEATURE).getHolder(resourcekey1).orElse(null); // CraftBukkit - decompile error
 
             if (holder1 == null) {
                 return false;
             } else {
+                setTreeType(holder1); // CraftBukkit
                 WorldGenFeatureConfigured<?, ?> worldgenfeatureconfigured1 = (WorldGenFeatureConfigured) holder1.value();
                 IBlockData iblockdata2 = worldserver.getFluidState(blockposition).createLegacyBlock();
 
@@ -165,11 +173,62 @@
         return true;
     }
 
+    // CraftBukkit start
+    private void setTreeType(Holder<WorldGenFeatureConfigured<?, ?>> holder) {
+        ResourceKey<WorldGenFeatureConfigured<?, ?>> worldgentreeabstract = holder.unwrapKey().get();
+        if (worldgentreeabstract == TreeFeatures.OAK || worldgentreeabstract == TreeFeatures.OAK_BEES_005) {
+            BlockSapling.treeType = TreeType.TREE;
+        } else if (worldgentreeabstract == TreeFeatures.HUGE_RED_MUSHROOM) {
+            BlockSapling.treeType = TreeType.RED_MUSHROOM;
+        } else if (worldgentreeabstract == TreeFeatures.HUGE_BROWN_MUSHROOM) {
+            BlockSapling.treeType = TreeType.BROWN_MUSHROOM;
+        } else if (worldgentreeabstract == TreeFeatures.JUNGLE_TREE) {
+            BlockSapling.treeType = TreeType.COCOA_TREE;
+        } else if (worldgentreeabstract == TreeFeatures.JUNGLE_TREE_NO_VINE) {
+            BlockSapling.treeType = TreeType.SMALL_JUNGLE;
+        } else if (worldgentreeabstract == TreeFeatures.PINE) {
+            BlockSapling.treeType = TreeType.TALL_REDWOOD;
+        } else if (worldgentreeabstract == TreeFeatures.SPRUCE) {
+            BlockSapling.treeType = TreeType.REDWOOD;
+        } else if (worldgentreeabstract == TreeFeatures.ACACIA) {
+            BlockSapling.treeType = TreeType.ACACIA;
+        } else if (worldgentreeabstract == TreeFeatures.BIRCH || worldgentreeabstract == TreeFeatures.BIRCH_BEES_005) {
+            BlockSapling.treeType = TreeType.BIRCH;
+        } else if (worldgentreeabstract == TreeFeatures.SUPER_BIRCH_BEES_0002) {
+            BlockSapling.treeType = TreeType.TALL_BIRCH;
+        } else if (worldgentreeabstract == TreeFeatures.SWAMP_OAK) {
+            BlockSapling.treeType = TreeType.SWAMP;
+        } else if (worldgentreeabstract == TreeFeatures.FANCY_OAK || worldgentreeabstract == TreeFeatures.FANCY_OAK_BEES_005) {
+            BlockSapling.treeType = TreeType.BIG_TREE;
+        } else if (worldgentreeabstract == TreeFeatures.JUNGLE_BUSH) {
+            BlockSapling.treeType = TreeType.JUNGLE_BUSH;
+        } else if (worldgentreeabstract == TreeFeatures.DARK_OAK) {
+            BlockSapling.treeType = TreeType.DARK_OAK;
+        } else if (worldgentreeabstract == TreeFeatures.MEGA_SPRUCE) {
+            BlockSapling.treeType = TreeType.MEGA_REDWOOD;
+        } else if (worldgentreeabstract == TreeFeatures.MEGA_PINE) {
+            BlockSapling.treeType = TreeType.MEGA_REDWOOD;
+        } else if (worldgentreeabstract == TreeFeatures.MEGA_JUNGLE_TREE) {
+            BlockSapling.treeType = TreeType.JUNGLE;
+        } else if (worldgentreeabstract == TreeFeatures.AZALEA_TREE) {
+            BlockSapling.treeType = TreeType.AZALEA;
+        } else if (worldgentreeabstract == TreeFeatures.MANGROVE) {
+            BlockSapling.treeType = TreeType.MANGROVE;
+        } else if (worldgentreeabstract == TreeFeatures.TALL_MANGROVE) {
+            BlockSapling.treeType = TreeType.TALL_MANGROVE;
+        } else if (worldgentreeabstract == TreeFeatures.CHERRY || worldgentreeabstract == TreeFeatures.CHERRY_BEES_005) {
+            BlockSapling.treeType = TreeType.CHERRY;
+        } else {
+            throw new IllegalArgumentException("Unknown tree generator " + worldgentreeabstract);
+        }
+    }
+    // CraftBukkit end
+
     static {
-        Function function = (worldgentreeprovider) -> {
+        Function<WorldGenTreeProvider, String> function = (worldgentreeprovider) -> { // CraftBukkit - decompile error
             return worldgentreeprovider.name;
         };
-        Map map = WorldGenTreeProvider.GROWERS;
+        Map<String, WorldGenTreeProvider> map = WorldGenTreeProvider.GROWERS; // CraftBukkit - decompile error
 
         Objects.requireNonNull(map);
         CODEC = ExtraCodecs.stringResolverCodec(function, map::get);
