--- a/net/minecraft/world/level/block/ChangeOverTimeBlock.java
+++ b/net/minecraft/world/level/block/ChangeOverTimeBlock.java
@@ -1,5 +1,6 @@
 package net.minecraft.world.level.block;
 
+import java.util.Iterator;
 import java.util.Optional;
 import net.minecraft.core.BlockPos;
 import net.minecraft.server.level.ServerLevel;
@@ -7,6 +8,7 @@
 import net.minecraft.world.level.block.state.BlockState;
 
 public interface ChangeOverTimeBlock<T extends Enum<T>> {
+
     int SCAN_DISTANCE = 4;
 
     Optional<BlockState> getNext(BlockState state);
@@ -15,9 +17,13 @@
 
     default void changeOverTime(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
         float f = 0.05688889F;
+
         if (random.nextFloat() < 0.05688889F) {
-            this.getNextState(state, world, pos, random).ifPresent(degraded -> world.setBlockAndUpdate(pos, degraded));
+            this.getNextState(state, world, pos, random).ifPresent((iblockdata1) -> {
+                org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world, pos, iblockdata1); // CraftBukkit
+            });
         }
+
     }
 
     T getAge();
@@ -26,32 +32,43 @@
         int i = this.getAge().ordinal();
         int j = 0;
         int k = 0;
+        Iterator iterator = BlockPos.withinManhattan(pos, 4, 4, 4).iterator();
+
+        while (iterator.hasNext()) {
+            BlockPos blockposition1 = (BlockPos) iterator.next();
+            int l = blockposition1.distManhattan(pos);
 
-        for (BlockPos blockPos : BlockPos.withinManhattan(pos, 4, 4, 4)) {
-            int l = blockPos.distManhattan(pos);
             if (l > 4) {
                 break;
             }
 
-            if (!blockPos.equals(pos) && world.getBlockState(blockPos).getBlock() instanceof ChangeOverTimeBlock<?> changeOverTimeBlock) {
-                Enum<?> enum_ = changeOverTimeBlock.getAge();
-                if (this.getAge().getClass() == enum_.getClass()) {
-                    int m = enum_.ordinal();
-                    if (m < i) {
-                        return Optional.empty();
-                    }
+            if (!blockposition1.equals(pos)) {
+                Block block = world.getBlockState(blockposition1).getBlock();
 
-                    if (m > i) {
-                        k++;
-                    } else {
-                        j++;
+                if (block instanceof ChangeOverTimeBlock) {
+                    ChangeOverTimeBlock<?> changeovertimeblock = (ChangeOverTimeBlock) block;
+                    Enum<?> oenum = changeovertimeblock.getAge();
+
+                    if (this.getAge().getClass() == oenum.getClass()) {
+                        int i1 = oenum.ordinal();
+
+                        if (i1 < i) {
+                            return Optional.empty();
+                        }
+
+                        if (i1 > i) {
+                            ++k;
+                        } else {
+                            ++j;
+                        }
                     }
                 }
             }
         }
 
-        float f = (float)(k + 1) / (float)(k + j + 1);
-        float g = f * f * this.getChanceModifier();
-        return random.nextFloat() < g ? this.getNext(state) : Optional.empty();
+        float f = (float) (k + 1) / (float) (k + j + 1);
+        float f1 = f * f * this.getChanceModifier();
+
+        return random.nextFloat() < f1 ? this.getNext(state) : Optional.empty();
     }
 }
