aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java.patch')
-rw-r--r--patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java.patch
new file mode 100644
index 0000000000..797b68dd95
--- /dev/null
+++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java.patch
@@ -0,0 +1,32 @@
+--- a/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java
++++ b/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java
+@@ -43,10 +42,14 @@
+ }
+
+ @Override
+- @Override
+- public void randomTick(BlockState blockstate, ServerLevel serverlevel, BlockPos blockpos, RandomSource randomsource) {
+- if (!canBeGrass(blockstate, serverlevel, blockpos)) {
+- serverlevel.setBlockAndUpdate(blockpos, Blocks.DIRT.defaultBlockState());
++ public void randomTick(IBlockData state, ServerLevel level, BlockPos pos, RandomSource random) {
++ if (!canBeGrass(state, level, pos)) {
++ // CraftBukkit start
++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(level, pos, Blocks.DIRT.defaultBlockState()).isCancelled()) {
++ return;
++ }
++ // CraftBukkit end
++ level.setBlockAndUpdate(pos, Blocks.DIRT.defaultBlockState());
+ } else {
+ if (serverlevel.getMaxLocalRawBrightness(blockpos.above()) >= 9) {
+ BlockState blockstate1 = this.defaultBlockState();
+@@ -54,8 +57,8 @@
+ for (int i = 0; i < 4; ++i) {
+ BlockPos blockpos1 = blockpos.offset(randomsource.nextInt(3) - 1, randomsource.nextInt(5) - 3, randomsource.nextInt(3) - 1);
+
+- if (serverlevel.getBlockState(blockpos1).is(Blocks.DIRT) && canPropagate(blockstate1, serverlevel, blockpos1)) {
+- serverlevel.setBlockAndUpdate(blockpos1, (BlockState) blockstate1.setValue(SpreadingSnowyDirtBlock.SNOWY, serverlevel.getBlockState(blockpos1.above()).is(Blocks.SNOW)));
++ if (level.getBlockState(blockposition1).is(Blocks.DIRT) && canPropagate(iblockdata1, level, blockposition1)) {
++ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(level, pos, blockposition1, (IBlockData) iblockdata1.setValue(SpreadingSnowyDirtBlock.SNOWY, level.getBlockState(blockposition1.above()).is(Blocks.SNOW))); // CraftBukkit
+ }
+ }
+ }