2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java
|
|
|
|
+++ b/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java
|
2023-12-05 17:40:00 +01:00
|
|
|
@@ -44,6 +44,11 @@
|
2019-12-10 23:00:00 +01:00
|
|
|
@Override
|
2022-06-07 18:00:00 +02:00
|
|
|
public void randomTick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, RandomSource randomsource) {
|
2021-11-21 23:00:00 +01:00
|
|
|
if (!canBeGrass(iblockdata, worldserver, blockposition)) {
|
2019-12-10 23:00:00 +01:00
|
|
|
+ // CraftBukkit start
|
2021-11-21 23:00:00 +01:00
|
|
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, Blocks.DIRT.defaultBlockState()).isCancelled()) {
|
2019-12-10 23:00:00 +01:00
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2021-11-21 23:00:00 +01:00
|
|
|
worldserver.setBlockAndUpdate(blockposition, Blocks.DIRT.defaultBlockState());
|
2019-12-10 23:00:00 +01:00
|
|
|
} else {
|
2021-11-21 23:00:00 +01:00
|
|
|
if (worldserver.getMaxLocalRawBrightness(blockposition.above()) >= 9) {
|
2023-12-05 17:40:00 +01:00
|
|
|
@@ -53,7 +58,7 @@
|
2022-06-07 18:00:00 +02:00
|
|
|
BlockPosition blockposition1 = blockposition.offset(randomsource.nextInt(3) - 1, randomsource.nextInt(5) - 3, randomsource.nextInt(3) - 1);
|
2018-07-15 02:00:00 +02:00
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
if (worldserver.getBlockState(blockposition1).is(Blocks.DIRT) && canPropagate(iblockdata1, worldserver, blockposition1)) {
|
|
|
|
- worldserver.setBlockAndUpdate(blockposition1, (IBlockData) iblockdata1.setValue(BlockDirtSnowSpreadable.SNOWY, worldserver.getBlockState(blockposition1.above()).is(Blocks.SNOW)));
|
|
|
|
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition1, (IBlockData) iblockdata1.setValue(BlockDirtSnowSpreadable.SNOWY, worldserver.getBlockState(blockposition1.above()).is(Blocks.SNOW))); // CraftBukkit
|
2018-07-15 02:00:00 +02:00
|
|
|
}
|
|
|
|
}
|
2019-12-10 23:00:00 +01:00
|
|
|
}
|