From 77c763b5ef5b33e8ce34866bf5ed3c94d43f298e Mon Sep 17 00:00:00 2001 From: Pedro <3602279+Doc94@users.noreply.github.com> Date: Sat, 22 Jun 2024 09:50:47 -0400 Subject: [PATCH] Fix PlayerShearBlockEvent drops ignored for Pumpkin (#10956) --- patches/server/0444-Add-PlayerShearBlockEvent.patch | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/patches/server/0444-Add-PlayerShearBlockEvent.patch b/patches/server/0444-Add-PlayerShearBlockEvent.patch index c56e74d255..c659b655c0 100644 --- a/patches/server/0444-Add-PlayerShearBlockEvent.patch +++ b/patches/server/0444-Add-PlayerShearBlockEvent.patch @@ -39,10 +39,10 @@ index c4b9c574bfb034fc78a596367f0f41dbde5eb93d..8d6736003934c5958f600660bdee58b3 flag = true; world.gameEvent((Entity) player, (Holder) GameEvent.SHEAR, pos); diff --git a/src/main/java/net/minecraft/world/level/block/PumpkinBlock.java b/src/main/java/net/minecraft/world/level/block/PumpkinBlock.java -index aa8667f0b14dc8944dd3457b431162e59bf54ada..3b94888516e4dd1a8e56c31fd71bb21f84b8cfbd 100644 +index aa8667f0b14dc8944dd3457b431162e59bf54ada..5f5b2dd2bb45a0d3ae7de063b3bc611d01af21c0 100644 --- a/src/main/java/net/minecraft/world/level/block/PumpkinBlock.java +++ b/src/main/java/net/minecraft/world/level/block/PumpkinBlock.java -@@ -40,10 +40,18 @@ public class PumpkinBlock extends Block { +@@ -40,16 +40,24 @@ public class PumpkinBlock extends Block { } else if (world.isClientSide) { return ItemInteractionResult.sidedSuccess(world.isClientSide); } else { @@ -61,6 +61,13 @@ index aa8667f0b14dc8944dd3457b431162e59bf54ada..3b94888516e4dd1a8e56c31fd71bb21f ItemEntity itemEntity = new ItemEntity( world, (double)pos.getX() + 0.5 + (double)direction2.getStepX() * 0.65, + (double)pos.getY() + 0.1, + (double)pos.getZ() + 0.5 + (double)direction2.getStepZ() * 0.65, +- new ItemStack(Items.PUMPKIN_SEEDS, 4) ++ org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(item) // Paper - Add PlayerShearBlockEvent + ); + itemEntity.setDeltaMovement( + 0.05 * (double)direction2.getStepX() + world.random.nextDouble() * 0.02, @@ -57,6 +65,7 @@ public class PumpkinBlock extends Block { 0.05 * (double)direction2.getStepZ() + world.random.nextDouble() * 0.02 );