MinecraftForge/MinecraftForge — pull request #1490 by shieldbug1 (2014-11-09 03:28:52+00:00)
Title: Added two methods to PlayerManager

These two methods are mainly for networking. This lets you send Packets to any players 'watching' any given chunk.

Example:

public static void sendMessageToTile(SimpleNetworkWrapper wrapper, TileEntity tileEntity, IMessage message)
{
if(tileEntity.getWorldObj() instanceof WorldServer)
{
((WorldServer)tileEntity.getWorldObj).getPlayerManager().sendToWatching(tileEntity.xCoord >> 4, tileEntity.zCoord >> 4, wrapper.getPacketFrom(message));
}
}