[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
2012-01-31 13:54:15 -06:00
committed by EvilSeph
parent 028cbb8fe9
commit 37c8868532
4 changed files with 82 additions and 25 deletions

View File

@@ -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) {