3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-22 14:28:09 +01:00
Paper/nms-patches/BlockDirtSnowSpreadable.patch

24 Zeilen
1.6 KiB
Diff

2018-07-15 02:00:00 +02:00
--- a/net/minecraft/server/BlockDirtSnowSpreadable.java
+++ b/net/minecraft/server/BlockDirtSnowSpreadable.java
2019-12-10 23:00:00 +01:00
@@ -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);
2018-07-15 02:00:00 +02:00
2019-12-10 23:00:00 +01:00
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
2018-07-15 02:00:00 +02:00
}
}
2019-12-10 23:00:00 +01:00
}