--- a/net/minecraft/world/level/block/grower/AbstractMegaTreeGrower.java
+++ b/net/minecraft/world/level/block/grower/AbstractMegaTreeGrower.java
@@ -13,11 +13,14 @@
 import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
 
 public abstract class AbstractMegaTreeGrower extends AbstractTreeGrower {
+
+    public AbstractMegaTreeGrower() {}
+
     @Override
     public boolean growTree(ServerLevel world, ChunkGenerator chunkGenerator, BlockPos pos, BlockState state, RandomSource random) {
-        for(int i = 0; i >= -1; --i) {
-            for(int j = 0; j >= -1; --j) {
-                if (isTwoByTwoSapling(state, world, pos, i, j)) {
+        for (int i = 0; i >= -1; --i) {
+            for (int j = 0; j >= -1; --j) {
+                if (AbstractMegaTreeGrower.isTwoByTwoSapling(state, world, pos, i, j)) {
                     return this.placeMega(world, chunkGenerator, pos, state, random, i, j);
                 }
             }
@@ -31,16 +34,19 @@
 
     public boolean placeMega(ServerLevel world, ChunkGenerator chunkGenerator, BlockPos pos, BlockState state, RandomSource random, int x, int z) {
         Holder<? extends ConfiguredFeature<?, ?>> holder = this.getConfiguredMegaFeature(random);
+
         if (holder == null) {
             return false;
         } else {
-            ConfiguredFeature<?, ?> configuredFeature = holder.value();
-            BlockState blockState = Blocks.AIR.defaultBlockState();
-            world.setBlock(pos.offset(x, 0, z), blockState, 4);
-            world.setBlock(pos.offset(x + 1, 0, z), blockState, 4);
-            world.setBlock(pos.offset(x, 0, z + 1), blockState, 4);
-            world.setBlock(pos.offset(x + 1, 0, z + 1), blockState, 4);
-            if (configuredFeature.place(world, chunkGenerator, random, pos.offset(x, 0, z))) {
+            setTreeType(holder); // CraftBukkit
+            ConfiguredFeature<?, ?> worldgenfeatureconfigured = (ConfiguredFeature) holder.value();
+            BlockState iblockdata1 = Blocks.AIR.defaultBlockState();
+
+            world.setBlock(pos.offset(x, 0, z), iblockdata1, 4);
+            world.setBlock(pos.offset(x + 1, 0, z), iblockdata1, 4);
+            world.setBlock(pos.offset(x, 0, z + 1), iblockdata1, 4);
+            world.setBlock(pos.offset(x + 1, 0, z + 1), iblockdata1, 4);
+            if (worldgenfeatureconfigured.place(world, chunkGenerator, random, pos.offset(x, 0, z))) {
                 return true;
             } else {
                 world.setBlock(pos.offset(x, 0, z), state, 4);
@@ -54,6 +60,7 @@
 
     public static boolean isTwoByTwoSapling(BlockState state, BlockGetter world, BlockPos pos, int x, int z) {
         Block block = state.getBlock();
+
         return world.getBlockState(pos.offset(x, 0, z)).is(block) && world.getBlockState(pos.offset(x + 1, 0, z)).is(block) && world.getBlockState(pos.offset(x, 0, z + 1)).is(block) && world.getBlockState(pos.offset(x + 1, 0, z + 1)).is(block);
     }
 }
