From 9d63b070a1ce9beafb23c4e3fdff540c4860493b Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Tue, 4 Oct 2022 20:28:46 -0700 Subject: [PATCH] Fix custom piglin interest items (#8097) --- .../0922-Fix-custom-piglin-loved-items.patch | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 patches/server/0922-Fix-custom-piglin-loved-items.patch diff --git a/patches/server/0922-Fix-custom-piglin-loved-items.patch b/patches/server/0922-Fix-custom-piglin-loved-items.patch new file mode 100644 index 000000000..316765e53 --- /dev/null +++ b/patches/server/0922-Fix-custom-piglin-loved-items.patch @@ -0,0 +1,21 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic +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 9f220cf0668b5153c419215e8e25e418e765a1d6..bf133cd7f6187253616fec331762e55dce73487c 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 +@@ -388,7 +388,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 + } + } +