2021-02-26 22:27:53 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Tom <cryptite@gmail.com>
|
|
|
|
Date: Fri, 26 Feb 2021 16:24:25 -0600
|
|
|
|
Subject: [PATCH] Expose Tracked Players
|
|
|
|
|
|
|
|
|
2021-03-16 07:19:45 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
|
|
index f64d37aa1183fe1a7c6f3131f945d9bd4e43bf3c..bb3211d0177f569b018852fc2a9094431e952b02 100644
|
|
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
|
|
@@ -165,7 +165,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
|
2021-02-26 22:27:53 +00:00
|
|
|
public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper
|
|
|
|
private CraftEntity bukkitEntity;
|
|
|
|
|
|
|
|
- PlayerChunkMap.EntityTracker tracker; // Paper
|
|
|
|
+ public PlayerChunkMap.EntityTracker tracker; // Paper package private -> public
|
|
|
|
boolean collisionLoadChunks = false; // Paper
|
|
|
|
Throwable addedToWorldStack; // Paper - entity debug
|
|
|
|
public CraftEntity getBukkitEntity() {
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
2021-03-16 07:19:45 +00:00
|
|
|
index 21304d60f90dbf2254ebf19cfda372f8c6d7c7f1..8a14343c253768c4a6a566e007e322cf0fb4f05c 100644
|
2021-02-26 22:27:53 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
|
|
@@ -16,6 +16,7 @@ import java.net.InetSocketAddress;
|
|
|
|
import java.net.SocketAddress;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Collection;
|
|
|
|
+import java.util.Collections; // Paper
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.HashSet;
|
|
|
|
import java.util.LinkedHashMap;
|
2021-03-09 18:03:27 +00:00
|
|
|
@@ -2297,6 +2298,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
2021-02-26 22:27:53 +00:00
|
|
|
}
|
|
|
|
// Paper end
|
|
|
|
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
|
|
|
+ public Set<Player> getTrackedPlayers() {
|
|
|
|
+ if (entity.tracker == null) {
|
|
|
|
+ return Collections.emptySet();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Set<Player> set = new HashSet<>(entity.tracker.trackedPlayers.size());
|
|
|
|
+ for (EntityPlayer entityPlayer : entity.tracker.trackedPlayers) {
|
|
|
|
+ set.add(entityPlayer.getBukkitEntity().getPlayer());
|
|
|
|
+ }
|
|
|
|
+ return set;
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
// Spigot start
|
|
|
|
private final Player.Spigot spigot = new Player.Spigot()
|
|
|
|
{
|