summaryrefslogtreecommitdiffstats
path: root/nms-patches/BlockMushroom.patch
blob: a9c3ba3ce8eb56873bda5815fb708e1fbffc6835 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
--- a/net/minecraft/server/BlockMushroom.java
+++ b/net/minecraft/server/BlockMushroom.java
@@ -3,6 +3,10 @@
 import java.util.Iterator;
 import java.util.Random;
 
+// CraftBukkit start
+import org.bukkit.TreeType;
+// CraftBukkit end
+
 public class BlockMushroom extends BlockPlant implements IBlockFragilePlantElement {
 
     protected static final VoxelShape a = Block.a(5.0D, 0.0D, 5.0D, 11.0D, 6.0D, 11.0D);
@@ -43,7 +47,7 @@
             }
 
             if (world.isEmpty(blockposition2) && iblockdata.canPlace(world, blockposition2)) {
-                world.setTypeAndData(blockposition2, iblockdata, 2);
+                org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(world, blockposition, blockposition2, iblockdata, 2); // CraftBukkit
             }
         }
 
@@ -66,8 +70,10 @@
         WorldGenerator worldgenerator = null;
 
         if (this == Blocks.BROWN_MUSHROOM) {
+            BlockSapling.treeType = TreeType.BROWN_MUSHROOM; // CraftBukkit
             worldgenerator = WorldGenerator.U;
         } else if (this == Blocks.RED_MUSHROOM) {
+            BlockSapling.treeType = TreeType.RED_MUSHROOM; // CraftBukkit
             worldgenerator = WorldGenerator.T;
         }