mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 07:48:53 +01:00
23 lines
1.6 KiB
Diff
23 lines
1.6 KiB
Diff
--- a/net/minecraft/server/BlockDirtSnowSpreadable.java
|
|
+++ b/net/minecraft/server/BlockDirtSnowSpreadable.java
|
|
@@ -30,6 +30,11 @@
|
|
@Override
|
|
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
|
|
if (!b(iblockdata, (IWorldReader) worldserver, blockposition)) {
|
|
+ // CraftBukkit start
|
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, Blocks.DIRT.getBlockData()).isCancelled()) {
|
|
+ return;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
worldserver.setTypeUpdate(blockposition, Blocks.DIRT.getBlockData());
|
|
} else {
|
|
if (worldserver.getLightLevel(blockposition.up()) >= 9) {
|
|
@@ -39,7 +44,7 @@
|
|
BlockPosition blockposition1 = blockposition.b(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1);
|
|
|
|
if (worldserver.getType(blockposition1).getBlock() == Blocks.DIRT && c(iblockdata1, (IWorldReader) worldserver, blockposition1)) {
|
|
- worldserver.setTypeUpdate(blockposition1, (IBlockData) iblockdata1.set(BlockDirtSnowSpreadable.a, worldserver.getType(blockposition1.up()).getBlock() == Blocks.SNOW));
|
|
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition1, (IBlockData) iblockdata1.set(BlockDirtSnowSpreadable.a, worldserver.getType(blockposition1.up()).getBlock() == Blocks.SNOW)); // CraftBukkit
|
|
}
|
|
}
|
|
}
|