diff options
author | Lulu13022002 <[email protected]> | 2024-08-25 19:27:31 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2024-08-25 19:27:31 +0200 |
commit | 5625051564924fb7be42408b4de7e1f030eca34d (patch) | |
tree | 8f8105bae847725e076f125ae28594bea1976318 | |
parent | 956b3d1c4ee40af348f5357f223d36c1813da41d (diff) | |
download | Paper-5625051564924fb7be42408b4de7e1f030eca34d.tar.gz Paper-5625051564924fb7be42408b4de7e1f030eca34d.zip |
Prevent duplicate pickup event for piglins (#11322)
-rw-r--r-- | patches/server/0752-EntityPickupItemEvent-fixes.patch | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/patches/server/0752-EntityPickupItemEvent-fixes.patch b/patches/server/0752-EntityPickupItemEvent-fixes.patch index 375a09d01d..91c0eac860 100644 --- a/patches/server/0752-EntityPickupItemEvent-fixes.patch +++ b/patches/server/0752-EntityPickupItemEvent-fixes.patch @@ -25,7 +25,7 @@ index d2dfa49e124460f4762b950f9ded106d2ec15dc2..bc58323801ee16fe9b63c21332144ec0 } diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java -index d3d50ec0f4466464c048449d8a844569c447d59b..0192b62fd66621a72fcf2f20896647e5950ba993 100644 +index d3d50ec0f4466464c048449d8a844569c447d59b..b9810a1f6ac91ae9631dd1ebc225f009d91b7845 100644 --- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java +++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java @@ -242,11 +242,16 @@ public class PiglinAi { @@ -46,6 +46,15 @@ index d3d50ec0f4466464c048449d8a844569c447d59b..0192b62fd66621a72fcf2f20896647e5 piglin.take(drop, 1); itemstack = PiglinAi.removeOneItemFromItemEntity(drop); } else { +@@ -261,7 +266,7 @@ public class PiglinAi { + } else if (PiglinAi.isFood(itemstack) && !PiglinAi.hasEatenRecently(piglin)) { + PiglinAi.eat(piglin); + } else { +- boolean flag = !piglin.equipItemIfPossible(itemstack, drop).equals(ItemStack.EMPTY); // CraftBukkit ++ boolean flag = !piglin.equipItemIfPossible(itemstack, null).equals(ItemStack.EMPTY); // CraftBukkit // Paper - pass null item entity to prevent duplicate pickup item event call - called above. + + if (!flag) { + PiglinAi.putInInventory(piglin, itemstack); 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 174d246b0a4d0fc9d769aad08da627ca8487bdf2..bbf21ea433f9e3963aac0ede597ed8d3c8e50ed8 100644 --- a/src/main/java/net/minecraft/world/entity/raid/Raider.java |