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.
This commit is contained in:
Jake Potrebic
2022-11-22 13:16:01 -08:00
parent ba6112b959
commit 012c32fac7
5 changed files with 73 additions and 17 deletions

View File

@@ -62,3 +62,15 @@
default boolean hasNearbyAlivePlayer(double x, double y, double z, double range) {
for (Player player : this.players()) {
if (EntitySelector.NO_SPECTATORS.test(player) && EntitySelector.LIVING_ENTITY_STILL_ALIVE.test(player)) {
@@ -124,4 +165,11 @@
return null;
}
+
+ // Paper start - check global player list where appropriate
+ @Nullable
+ default Player getGlobalPlayerByUUID(UUID uuid) {
+ return this.getPlayerByUUID(uuid);
+ }
+ // Paper end - check global player list where appropriate
}