mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-16 06:30:46 +01:00
Fix custom piglin interest items (#8097)
This commit is contained in:
parent
bf82a75a52
commit
6e4207e2d9
1 changed files with 21 additions and 0 deletions
21
patches/server/Fix-custom-piglin-loved-items.patch
Normal file
21
patches/server/Fix-custom-piglin-loved-items.patch
Normal file
|
@ -0,0 +1,21 @@
|
|||
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
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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
|
||||
@@ -0,0 +0,0 @@ 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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in a new issue