aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/DoublePlantBlock.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/DoublePlantBlock.java.patch')
-rw-r--r--patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/DoublePlantBlock.java.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/DoublePlantBlock.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/DoublePlantBlock.java.patch
new file mode 100644
index 0000000000..c37c0fc460
--- /dev/null
+++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/DoublePlantBlock.java.patch
@@ -0,0 +1,35 @@
+--- a/net/minecraft/world/level/block/DoublePlantBlock.java
++++ b/net/minecraft/world/level/block/DoublePlantBlock.java
+@@ -105,15 +100,23 @@
+ super.playerDestroy(level, player, pos, Blocks.AIR.defaultBlockState(), te, stack);
+ }
+
+- protected static void preventDropFromBottomPart(Level level, BlockPos blockPos, BlockState blockState, Player player) {
+- DoubleBlockHalf doubleBlockHalf = blockState.getValue(HALF);
+- if (doubleBlockHalf == DoubleBlockHalf.UPPER) {
+- BlockPos blockPos1 = blockPos.below();
+- BlockState blockState1 = level.getBlockState(blockPos1);
+- if (blockState1.is(blockState.getBlock()) && blockState1.getValue(HALF) == DoubleBlockHalf.LOWER) {
+- BlockState blockState2 = blockState1.getFluidState().is(Fluids.WATER) ? Blocks.WATER.defaultBlockState() : Blocks.AIR.defaultBlockState();
+- level.setBlock(blockPos1, blockState2, 35);
+- level.levelEvent(player, 2001, blockPos1, Block.getId(blockState1));
++ protected static void preventDropFromBottomPart(Level world, BlockPos blockposition, IBlockData iblockdata, Player entityhuman) {
++ // CraftBukkit start
++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPhysicsEvent(world, blockposition).isCancelled()) {
++ return;
++ }
++ // CraftBukkit end
++ BlockPropertyDoubleBlockHalf blockpropertydoubleblockhalf = (BlockPropertyDoubleBlockHalf) iblockdata.getValue(DoublePlantBlock.HALF);
++
++ if (blockpropertydoubleblockhalf == BlockPropertyDoubleBlockHalf.UPPER) {
++ BlockPos blockposition1 = blockposition.below();
++ IBlockData iblockdata1 = world.getBlockState(blockposition1);
++
++ if (iblockdata1.is(iblockdata.getBlock()) && iblockdata1.getValue(DoublePlantBlock.HALF) == BlockPropertyDoubleBlockHalf.LOWER) {
++ IBlockData iblockdata2 = iblockdata1.getFluidState().is((Fluid) Fluids.WATER) ? Blocks.WATER.defaultBlockState() : Blocks.AIR.defaultBlockState();
++
++ world.setBlock(blockposition1, iblockdata2, 35);
++ world.levelEvent(entityhuman, 2001, blockposition1, Block.getId(iblockdata1));
+ }
+ }
+ }