PaperMC/paper-server/nms-patches/net/minecraft/world/level/block/BlockDirtSnowSpreadable.patch
CraftBukkit/Spigot b3a8254758 Update to Minecraft 1.17
By: md_5 <git@md-5.net>
2021-06-11 15:00:00 +10:00

23 lines
1.6 KiB
Diff

--- a/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java
+++ b/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java
@@ -42,6 +42,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) {
@@ -51,7 +56,7 @@
BlockPosition blockposition1 = blockposition.c(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1);
if (worldserver.getType(blockposition1).a(Blocks.DIRT) && c(iblockdata1, (IWorldReader) worldserver, blockposition1)) {
- worldserver.setTypeUpdate(blockposition1, (IBlockData) iblockdata1.set(BlockDirtSnowSpreadable.SNOWY, worldserver.getType(blockposition1.up()).a(Blocks.SNOW)));
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition1, (IBlockData) iblockdata1.set(BlockDirtSnowSpreadable.SNOWY, worldserver.getType(blockposition1.up()).a(Blocks.SNOW))); // CraftBukkit
}
}
}