Bukkit/CraftBukkit — pull request #879 by Anxuiz (2012-08-30 18:16:20+00:00)
Title: Fix BUKKIT-2210: Vanished players are still generating movement sounds for normal players

CraftBukkit sends sounds that originate from an entity to every player, regardless of that entity's visibility to the player. Propagate the originator through methods to the actual packet sending, then check whether the entity is visible before sending the packet.

I tried to modify the least amount of code in order to fix this bug, unfortunately it meant making some rather large assumptions (for example: broadcasting a sound from an entity should always check visibility).