mbax/VanishNoPacket — pull request #95 by AgentME (2012-02-13 05:38:28+00:00)
Title: Set who a player can see as soon as they join.

ListenPlayerJoin.java catches the player join event twice, one hook being at low priority and one at high priority. The low priority one runs first on player join and sets whether the player is invisible, and then runs plugin hooks. The high priority one runs last, displays some messages to the player if necessary, and then sets what other players the new player can see.

This commit moves setting what other players the new player can see to the low priority hook, so it runs early, before many other plugins process the join event. (Main case is for a plugin that shows who is online when a player joins (and follows the Bukkit Vanish API); we want to have invisible players hidden from the new player before the new player is shown a list of players.) This also has the benefit of providing a clear distinction between the purposes of the low priority and high priority hooks. The high priority hook is solely for showing messages to the new player now.