aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPedro <[email protected]>2024-06-22 09:50:47 -0400
committerGitHub <[email protected]>2024-06-22 14:50:47 +0100
commit77c763b5ef5b33e8ce34866bf5ed3c94d43f298e (patch)
tree2953f167670692d18c9fbf931cb0ed2983f811af
parent19105a9019d7e67fac176dd9b9709cd25c213d31 (diff)
downloadPaper-77c763b5ef5b33e8ce34866bf5ed3c94d43f298e.tar.gz
Paper-77c763b5ef5b33e8ce34866bf5ed3c94d43f298e.zip
Fix PlayerShearBlockEvent drops ignored for Pumpkin (#10956)
-rw-r--r--patches/server/0444-Add-PlayerShearBlockEvent.patch11
1 files 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
);