2022-10-05 05:28:46 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
|
|
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
|
2023-06-08 10:47:19 +02:00
|
|
|
index c8e6893a7d2be08d6b0d111aa6e58e72f3376edc..5f2bb0160c49d404a06551880e08c589a5b2a0a7 100644
|
2022-10-05 05:28:46 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java
|
2022-12-07 23:05:32 +01:00
|
|
|
@@ -402,7 +402,7 @@ public class PiglinAi {
|
2022-10-05 05:28:46 +02:00
|
|
|
} 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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|