From bee74680e607c2e29b038329f62181238911cd83 Mon Sep 17 00:00:00 2001 From: MiniDigger | Martin Date: Sun, 14 Jan 2024 11:04:49 +0100 Subject: add remapped patches as a test --- .../level/block/BlockDirtSnowSpreadable.patch | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 patch-remap/og/net/minecraft/world/level/block/BlockDirtSnowSpreadable.patch (limited to 'patch-remap/og/net/minecraft/world/level/block/BlockDirtSnowSpreadable.patch') 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 + } + } + } -- cgit v1.2.3