aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0754-Fix-custom-piglin-loved-items.patch
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2024-06-14 14:07:44 -0700
committerJake Potrebic <[email protected]>2024-06-14 14:07:44 -0700
commitffe310a8e1dd4ed1027e903b4683f0ab42ee9ff8 (patch)
tree7748595488691c8494b5bdb2d01711a5242f6b34 /patches/server/0754-Fix-custom-piglin-loved-items.patch
parent188cff20c75367d8c90ae548a0dd528805d4a5a3 (diff)
downloadPaper-ffe310a8e1dd4ed1027e903b4683f0ab42ee9ff8.tar.gz
Paper-ffe310a8e1dd4ed1027e903b4683f0ab42ee9ff8.zip
remove api that was scheduled for removal
Diffstat (limited to 'patches/server/0754-Fix-custom-piglin-loved-items.patch')
-rw-r--r--patches/server/0754-Fix-custom-piglin-loved-items.patch21
1 files changed, 21 insertions, 0 deletions
diff --git a/patches/server/0754-Fix-custom-piglin-loved-items.patch b/patches/server/0754-Fix-custom-piglin-loved-items.patch
new file mode 100644
index 0000000000..a09a51f7ea
--- /dev/null
+++ b/patches/server/0754-Fix-custom-piglin-loved-items.patch
@@ -0,0 +1,21 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jake Potrebic <[email protected]>
+Date: Mon, 4 Jul 2022 21:50:44 -0700
+Subject: [PATCH] Fix custom piglin loved items
+
+Upstream didn't modify the isLovedItem check in wantsToPickup
+so piglins never actually tried to pickup interestItems
+
+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 d601bff8e8f62af78791ad357b51b92faf04e55f..d3d50ec0f4466464c048449d8a844569c447d59b 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
+@@ -403,7 +403,7 @@ public class PiglinAi {
+ } else {
+ boolean flag = piglin.canAddToInventory(stack);
+
+- return stack.is(Items.GOLD_NUGGET) ? flag : (PiglinAi.isFood(stack) ? !PiglinAi.hasEatenRecently(piglin) && flag : (!PiglinAi.isLovedItem(stack) ? piglin.canReplaceCurrentItem(stack) : PiglinAi.isNotHoldingLovedItemInOffHand(piglin) && flag));
++ return stack.is(Items.GOLD_NUGGET) ? flag : (PiglinAi.isFood(stack) ? !PiglinAi.hasEatenRecently(piglin) && flag : (!PiglinAi.isLovedItem(stack, piglin) ? piglin.canReplaceCurrentItem(stack) : PiglinAi.isNotHoldingLovedItemInOffHand(piglin) && flag)); // Paper - upstream missed isLovedItem check
+ }
+ }
+