diff --git a/patches/server/EntityPickupItemEvent-fixes.patch b/patches/server/EntityPickupItemEvent-fixes.patch index 8e20053376..a51631d5ef 100644 --- a/patches/server/EntityPickupItemEvent-fixes.patch +++ b/patches/server/EntityPickupItemEvent-fixes.patch @@ -36,18 +36,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start - fix event firing twice + if (drop.getItem().is(Items.GOLD_NUGGET) /* && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(piglin, drop, 0, false).isCancelled() */) { + if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(piglin, drop, 0, false).isCancelled()) return; ++ piglin.onItemPickup(drop); // Paper - moved from Piglin#pickUpItem - call prior to item entity modification + // Paper end piglin.take(drop, drop.getItem().getCount()); itemstack = drop.getItem(); drop.discard(); -@@ -0,0 +0,0 @@ public class PiglinAi { + } else if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(piglin, drop, drop.getItem().getCount() - 1, false).isCancelled()) { ++ piglin.onItemPickup(drop); // Paper - moved from Piglin#pickUpItem - call prior to item entity modification + piglin.take(drop, 1); + itemstack = PiglinAi.removeOneItemFromItemEntity(drop); } else { - return; - } -+ piglin.onItemPickup(drop); // Paper - moved from Piglin#pickUpItem - // CraftBukkit end - - if (PiglinAi.isLovedItem(itemstack, piglin)) { // CraftBukkit - Changes to allow for custom payment in bartering diff --git a/src/main/java/net/minecraft/world/entity/raid/Raider.java b/src/main/java/net/minecraft/world/entity/raid/Raider.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/raid/Raider.java