summaryrefslogtreecommitdiffstats
path: root/nms-patches/BlockDirtSnowSpreadable.patch
blob: af18d01d07bcfd448cab2cd4a2e9266125b03e09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--- a/net/minecraft/server/BlockDirtSnowSpreadable.java
+++ b/net/minecraft/server/BlockDirtSnowSpreadable.java
@@ -23,6 +23,11 @@
     public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) {
         if (!world.isClientSide) {
             if (!a((IWorldReader) world, blockposition)) {
+                // CraftBukkit start
+                if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world, blockposition, Blocks.DIRT.getBlockData()).isCancelled()) {
+                    return;
+                }
+                // CraftBukkit end
                 world.setTypeUpdate(blockposition, Blocks.DIRT.getBlockData());
             } else {
                 if (world.getLightLevel(blockposition.up()) >= 9) {
@@ -34,7 +39,7 @@
                         }
 
                         if (world.getType(blockposition1).getBlock() == Blocks.DIRT && b(world, blockposition1)) {
-                            world.setTypeUpdate(blockposition1, this.getBlockData());
+                            org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(world, blockposition, blockposition1, this.getBlockData()); // CraftBukkit
                         }
                     }
                 }