diff --git a/patches/server/check-global-player-list-where-appropriate.patch b/patches/server/check-global-player-list-where-appropriate.patch index 65f53dd416..f6d501e782 100644 --- a/patches/server/check-global-player-list-where-appropriate.patch +++ b/patches/server/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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 @@ -21,6 +23,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java ++++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +@@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Animal.java