3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-24 15:20:11 +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-04-23 04:00:00 +02:00
@@ -31,6 +31,11 @@
public void tick(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) {
2018-07-15 02:00:00 +02:00
if (!world.isClientSide) {
2019-04-23 04:00:00 +02:00
if (!b(iblockdata, (IWorldReader) world, blockposition)) {
2018-07-15 02:00:00 +02:00
+ // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world, blockposition, Blocks.DIRT.getBlockData()).isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
world.setTypeUpdate(blockposition, Blocks.DIRT.getBlockData());
2019-04-23 04:00:00 +02:00
} else if (world.getLightLevel(blockposition.up()) >= 4) {
2018-07-15 02:00:00 +02:00
if (world.getLightLevel(blockposition.up()) >= 9) {
2019-04-23 04:00:00 +02:00
@@ -40,7 +45,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-04-23 04:00:00 +02:00
if (world.getType(blockposition1).getBlock() == Blocks.DIRT && c(iblockdata1, (IWorldReader) world, blockposition1)) {
- world.setTypeUpdate(blockposition1, (IBlockData) iblockdata1.set(BlockDirtSnowSpreadable.a, world.getType(blockposition1.up()).getBlock() == Blocks.SNOW));
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(world, blockposition, blockposition1, (IBlockData) iblockdata1.set(BlockDirtSnowSpreadable.a, world.getType(blockposition1.up()).getBlock() == Blocks.SNOW)); // CraftBukkit
2018-07-15 02:00:00 +02:00
}
}
}