mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-21 00:17:56 +01:00
Fix PlayerShearBlockEvent drops ignored for Pumpkin (#10956)
This commit is contained in:
parent
19105a9019
commit
77c763b5ef
@ -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
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user