mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 07:48:53 +01:00
Prevent duplicate pickup event for piglins (#11322)
This commit is contained in:
parent
5f317598d4
commit
403db04ae4
1 changed files with 9 additions and 0 deletions
|
@ -46,6 +46,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
piglin.take(drop, 1);
|
piglin.take(drop, 1);
|
||||||
itemstack = PiglinAi.removeOneItemFromItemEntity(drop);
|
itemstack = PiglinAi.removeOneItemFromItemEntity(drop);
|
||||||
} else {
|
} else {
|
||||||
|
@@ -0,0 +0,0 @@ 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
|
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
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/raid/Raider.java
|
--- a/src/main/java/net/minecraft/world/entity/raid/Raider.java
|
||||||
|
|
Loading…
Reference in a new issue