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
|
2022-10-27 02:32:03 +02:00
|
|
|
index 20c234e29e7c1f64a0fdbbe92e06efe8c99e6172..0ee023afcf5673df4b069f70ce90a2c3417d71b6 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-10-27 02:32:03 +02:00
|
|
|
@@ -392,7 +392,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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|