--- a/net/minecraft/world/level/block/FungusBlock.java
+++ b/net/minecraft/world/level/block/FungusBlock.java
@@ -21,22 +21,22 @@
 import net.minecraft.world.phys.shapes.VoxelShape;
 
 public class FungusBlock extends BushBlock implements BonemealableBlock {
-    public static final MapCodec<FungusBlock> CODEC = RecordCodecBuilder.mapCodec(
-        instance -> instance.group(
-                    ResourceKey.codec(Registries.CONFIGURED_FEATURE).fieldOf("feature").forGetter(block -> block.feature),
-                    BuiltInRegistries.BLOCK.byNameCodec().fieldOf("grows_on").forGetter(block -> block.requiredBlock),
-                    propertiesCodec()
-                )
-                .apply(instance, FungusBlock::new)
-    );
-    protected static final VoxelShape SHAPE = Block.box(4.0, 0.0, 4.0, 12.0, 9.0, 12.0);
-    private static final double BONEMEAL_SUCCESS_PROBABILITY = 0.4;
+
+    public static final MapCodec<FungusBlock> CODEC = RecordCodecBuilder.mapCodec((instance) -> {
+        return instance.group(ResourceKey.codec(Registries.CONFIGURED_FEATURE).fieldOf("feature").forGetter((blockfungi) -> {
+            return blockfungi.feature;
+        }), BuiltInRegistries.BLOCK.byNameCodec().fieldOf("grows_on").forGetter((blockfungi) -> {
+            return blockfungi.requiredBlock;
+        }), propertiesCodec()).apply(instance, FungusBlock::new);
+    });
+    protected static final VoxelShape SHAPE = Block.box(4.0D, 0.0D, 4.0D, 12.0D, 9.0D, 12.0D);
+    private static final double BONEMEAL_SUCCESS_PROBABILITY = 0.4D;
     private final Block requiredBlock;
     private final ResourceKey<ConfiguredFeature<?, ?>> feature;
 
     @Override
     public MapCodec<FungusBlock> codec() {
-        return CODEC;
+        return FungusBlock.CODEC;
     }
 
     protected FungusBlock(ResourceKey<ConfiguredFeature<?, ?>> featureKey, Block nylium, BlockBehaviour.Properties settings) {
@@ -47,7 +47,7 @@
 
     @Override
     protected VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
-        return SHAPE;
+        return FungusBlock.SHAPE;
     }
 
     @Override
@@ -61,17 +61,27 @@
 
     @Override
     public boolean isValidBonemealTarget(LevelReader world, BlockPos pos, BlockState state) {
-        BlockState blockState = world.getBlockState(pos.below());
-        return blockState.is(this.requiredBlock);
+        BlockState iblockdata1 = world.getBlockState(pos.below());
+
+        return iblockdata1.is(this.requiredBlock);
     }
 
     @Override
     public boolean isBonemealSuccess(Level world, RandomSource random, BlockPos pos, BlockState state) {
-        return (double)random.nextFloat() < 0.4;
+        return (double) random.nextFloat() < 0.4D;
     }
 
     @Override
     public void performBonemeal(ServerLevel world, RandomSource random, BlockPos pos, BlockState state) {
-        this.getFeature(world).ifPresent(featureEntry -> featureEntry.value().place(world, world.getChunkSource().getGenerator(), random, pos));
+        this.getFeature(world).ifPresent((holder) -> {
+            // CraftBukkit start
+            if (this == Blocks.WARPED_FUNGUS) {
+                SaplingBlock.treeType = org.bukkit.TreeType.WARPED_FUNGUS;
+            } else if (this == Blocks.CRIMSON_FUNGUS) {
+                SaplingBlock.treeType = org.bukkit.TreeType.CRIMSON_FUNGUS;
+            }
+            // CraftBukkit end
+            ((ConfiguredFeature) holder.value()).place(world, world.getChunkSource().getGenerator(), random, pos);
+        });
     }
 }
