3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 20:40:07 +01:00
Paper/nms-patches/BlockMushroom.patch
2018-07-15 10:00:00 +10:00

42 Zeilen
1.5 KiB
Diff

--- 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);
@@ -16,6 +20,7 @@
}
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) {
+ final int sourceX = blockposition.getX(), sourceY = blockposition.getY(), sourceZ = blockposition.getZ(); // CraftBukkit
if (random.nextInt(25) == 0) {
int i = 5;
boolean flag = true;
@@ -43,7 +48,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 +71,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;
}