From ffab9f2bc1f3e50e0a5fb81ad1306048a9d63a3e Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Tue, 14 Mar 2023 17:36:12 -0700 Subject: [PATCH] Add back item entity global player list check --- ...eck-global-player-list-where-appropriate.patch | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/patches/server/0922-check-global-player-list-where-appropriate.patch b/patches/server/0922-check-global-player-list-where-appropriate.patch index 708d1f2641..a3adbf37e2 100644 --- a/patches/server/0922-check-global-player-list-where-appropriate.patch +++ b/patches/server/0922-check-global-player-list-where-appropriate.patch @@ -3,6 +3,8 @@ From: Jake Potrebic Date: Tue, 22 Nov 2022 13:16:01 -0800 Subject: [PATCH] check global player list where appropriate +Makes certain entities check all players when searching for a player +instead of just checking players in their world. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java index e265a11ef8cbb7b4da6dac01eb7f1aa45e0d6869..5a5ff40df37db9cbd53c584ed26a3ce4888b29c0 100644 @@ -21,6 +23,19 @@ index e265a11ef8cbb7b4da6dac01eb7f1aa45e0d6869..5a5ff40df37db9cbd53c584ed26a3ce4 + } + // Paper end } +diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java +index 80970c877b9e729fc88451745a490f0b80a7c1b6..a7d74f16d82853f40d5641794dc12a8404359c94 100644 +--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java ++++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +@@ -3571,7 +3571,7 @@ public abstract class LivingEntity extends Entity implements Attackable { + } + + public void onItemPickup(ItemEntity item) { +- Entity entity = item.getOwner(); ++ Entity entity = item.thrower != null ? this.level.getGlobalPlayerByUUID(item.thrower) : null; // Paper - check all players + + if (entity instanceof ServerPlayer) { + CriteriaTriggers.THROWN_ITEM_PICKED_UP_BY_ENTITY.trigger((ServerPlayer) entity, item.getItem(), this); diff --git a/src/main/java/net/minecraft/world/entity/animal/Animal.java b/src/main/java/net/minecraft/world/entity/animal/Animal.java index 6216513805add7c8f52e1ed6c77e2d26786b3ab5..3c4d142e982c34a23bdb5da1f51c8dcacc0532c1 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Animal.java