aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/og/net/minecraft/world/level/block/BlockDirtSnowSpreadable.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/og/net/minecraft/world/level/block/BlockDirtSnowSpreadable.patch')
-rw-r--r--patch-remap/og/net/minecraft/world/level/block/BlockDirtSnowSpreadable.patch23
1 files changed, 23 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/level/block/BlockDirtSnowSpreadable.patch b/patch-remap/og/net/minecraft/world/level/block/BlockDirtSnowSpreadable.patch
new file mode 100644
index 0000000000..8bee36a94b
--- /dev/null
+++ b/patch-remap/og/net/minecraft/world/level/block/BlockDirtSnowSpreadable.patch
@@ -0,0 +1,23 @@
+--- a/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java
++++ b/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java
+@@ -44,6 +44,11 @@
+ @Override
+ public void randomTick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, RandomSource randomsource) {
+ if (!canBeGrass(iblockdata, worldserver, blockposition)) {
++ // CraftBukkit start
++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, Blocks.DIRT.defaultBlockState()).isCancelled()) {
++ return;
++ }
++ // CraftBukkit end
+ worldserver.setBlockAndUpdate(blockposition, Blocks.DIRT.defaultBlockState());
+ } else {
+ if (worldserver.getMaxLocalRawBrightness(blockposition.above()) >= 9) {
+@@ -53,7 +58,7 @@
+ BlockPosition blockposition1 = blockposition.offset(randomsource.nextInt(3) - 1, randomsource.nextInt(5) - 3, randomsource.nextInt(3) - 1);
+
+ 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
+ }
+ }
+ }