36 lines
1.4 KiB
Diff
36 lines
1.4 KiB
Diff
--- ../src-base/minecraft/net/minecraft/entity/EntityTracker.java
|
|
+++ ../src-work/minecraft/net/minecraft/entity/EntityTracker.java
|
|
@@ -58,6 +58,8 @@
|
|
|
|
public void func_72786_a(Entity p_72786_1_)
|
|
{
|
|
+ if (net.minecraftforge.fml.common.registry.EntityRegistry.instance().tryTrackingEntity(this, p_72786_1_)) return;
|
|
+
|
|
if (p_72786_1_ instanceof EntityPlayerMP)
|
|
{
|
|
this.func_72791_a(p_72786_1_, 512, 2);
|
|
@@ -355,4 +357,23 @@
|
|
}
|
|
}
|
|
}
|
|
+
|
|
+ /* ======================================== FORGE START =====================================*/
|
|
+
|
|
+ // don't expose the EntityTrackerEntry directly so mods can't mess with the data in there as easily
|
|
+ /**
|
|
+ * Get all players tracking the given Entity. The Entity must be part of the World that this Tracker belongs to.
|
|
+ * @param entity the Entity
|
|
+ * @return all players tracking the Entity
|
|
+ */
|
|
+ public Set<net.minecraft.entity.player.EntityPlayer> getTrackingPlayers(Entity entity)
|
|
+ {
|
|
+ EntityTrackerEntry entry = (EntityTrackerEntry) field_72794_c.func_76041_a(entity.func_145782_y());
|
|
+ if (entry == null)
|
|
+ return java.util.Collections.emptySet();
|
|
+ else
|
|
+ return java.util.Collections.unmodifiableSet(entry.field_73134_o);
|
|
+ }
|
|
+
|
|
+ /* ======================================== FORGE END =====================================*/
|
|
}
|