From 3f25236f90dd55e88351cd104bb6a8a0e8ddf567 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Fri, 3 Feb 2012 05:11:44 -0500 Subject: [PATCH] Prevent the Vanish API from sending unnecessary packets. By: EvilSeph --- .../main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index e91726375d..ead6a43028 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -564,6 +564,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void hidePlayer(Player player) { + if (hiddenPlayers.contains(player)) return; hiddenPlayers.add(player); //remove this player from the hidden player's EntityTrackerEntry @@ -579,6 +580,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void showPlayer(Player player) { + if (!hiddenPlayers.contains(player)) return; hiddenPlayers.remove(player); EntityTracker tracker = ((WorldServer) entity.world).tracker;