[Bleeding] Implemented Vanish API.

Remove players that cannot see a player from their EntityTrackerEntry and only
send user list updates to players who can see the player they reference.
This commit is contained in:
Travis Watkins authored and EvilSeph committed 2012-02-03 03:34:03 -05:00
1 parent 028cbb8fe9
commit 37c8868532
4 files changed
+82 -25

No files matched your search

@@ -187,6 +187,14 @@ public class EntityTrackerEntry {
if (d0 >= (double) (-this.b) && d0 <= (double) this.b && d1 >= (double) (-this.b) && d1 <= (double) this.b) {
if (!this.trackedPlayers.contains(entityplayer)) {
// CraftBukkit start
if (tracker instanceof EntityPlayer) {
org.bukkit.entity.Player player = ((EntityPlayer) tracker).getBukkitEntity();
if (!entityplayer.getBukkitEntity().canSee(player)) {
return;
}
}
// CraftBukkit end
this.trackedPlayers.add(entityplayer);
entityplayer.netServerHandler.sendPacket(this.b());
if (this.isMoving) {