Buggy code:
public enum PlayerInjectHooks { NONE , NETWORK_MANAGER_OBJECT , NETWORK_HANDLER_FIELDS , NETWORK_SERVER_OBJECT ; } private static final int UNHOOK_DELAY = 5 * ( PacketFilterManager . TICKS_PER_SECOND ) ; private DelayedSingleTask unhookTask ; private Set < PacketListener > packetListeners = Collections . newSetFromMap ( new ConcurrentHashMap < PacketListener , Boolean > ( ) ) ; private PacketInjector packetInjector ; private PlayerInjectionHandler playerInjection ; private InterceptWritePacket interceptWritePacket ; private volatile Set < PacketType > inputBufferedPackets = Sets . newHashSet ( ) ; private SortedPacketListenerList recievedListeners ; private SortedPacketListenerList sendingListeners ; private volatile boolean hasClosed ; private ClassLoader classLoader ; private ErrorReporter reporter ; private Server server ; private Plugin library ; private AsyncFilterManager asyncFilterManager ; private boolean knowsServerPackets ; private boolean knowsClientPackets ; private AtomicInteger phaseLoginCount = new AtomicInteger ( 0 ) ; private AtomicInteger phasePlayingCount = new AtomicInteger ( 0 ) ; private AtomicBoolean packetCreation = new AtomicBoolean ( ) ; private SpigotPacketInjector spigotInjector ; private ProtocolInjector nettyInjector ; private PluginVerifier pluginVerifier ; private boolean hasRecycleDistance = true ; private MinecraftVersion minecraftVersion ; private LoginPackets loginPackets ; private boolean debug ; public PacketFilterManager ( PacketFilterBuilder builder ) { } public static PacketFilterBuilder newBuilder ( ) { } @ Override public int getProtocolVersion ( Player player ) { } @ Override public MinecraftVersion getMinecraftVersion ( ) { } @ Override public AsynchronousManager getAsynchronousManager ( ) { } @ Override public boolean isDebug ( ) { } @ Override public void setDebug ( boolean debug ) { } @ Override public PacketFilterManager . PlayerInjectHooks getPlayerHook ( ) { } @ Override public void setPlayerHook ( PacketFilterManager . PlayerInjectHooks playerHook ) { } @ Override public ImmutableSet < PacketListener > getPacketListeners ( ) { } @ Override public InterceptWritePacket getInterceptWritePacket ( ) { } private void printPluginWarnings ( Plugin plugin ) { } @ Override public void addPacketListener ( PacketListener listener ) { } private GamePhase processPhase ( ListeningWhitelist whitelist ) { } private void updateRequireInputBuffers ( ) { } private void incrementPhases ( GamePhase phase ) { } private void decrementPhases ( GamePhase phase ) { } public static void verifyWhitelist ( PacketListener listener , ListeningWhitelist whitelist ) { } @ Override public void removePacketListener ( PacketListener listener ) { } @ Override public void removePacketListeners ( Plugin plugin ) { } @ Override public void invokePacketRecieving ( PacketEvent event ) { } @ Override public void invokePacketSending ( PacketEvent event ) { } @ Override public boolean requireInputBuffer ( int packetId ) { } private void handlePacket ( SortedPacketListenerList packetListeners , PacketEvent event , boolean sending ) { } private boolean hasAsyncCancelled ( AsyncMarker marker ) { } private void enablePacketFilters ( PacketListener listener , Iterable < PacketType > packets ) { } private void disablePacketFilters ( ConnectionSide side , Iterable < PacketType > packets ) { } @ Override public void broadcastServerPacket ( PacketContainer packet ) { } @ Override public void broadcastServerPacket ( PacketContainer packet , Entity entity , boolean includeTracker ) { } @ Override public void broadcastServerPacket ( PacketContainer packet , Location origin , int maxObserverDistance ) { try { int maxDistance = maxObserverDistance * maxObserverDistance ; World world = origin . getWorld ( ) ; Location recycle = origin . clone ( ) ; <START_BUG> for ( Player player : server . getOnlinePlayers ( ) ) { <END_BUG> if ( ( world . equals ( player . getWorld ( ) ) ) && ( ( getDistanceSquared ( origin , recycle , player ) ) <= maxDistance ) ) { sendServerPacket ( player , packet ) ; } } } catch ( InvocationTargetException e ) { throw new FieldAccessException ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>send<seq2seq4repair_space>server<seq2seq4repair_space>packet." , e ) ; } } private double getDistanceSquared ( Location origin , Location recycle , Player player ) { } private void broadcastServerPacket ( PacketContainer packet , Iterable < Player > players ) { } @ Override public void sendServerPacket ( Player reciever , PacketContainer packet ) throws InvocationTargetException { } @ Override public void sendServerPacket ( Player reciever , PacketContainer packet , boolean filters ) throws InvocationTargetException { } @ Override public void sendServerPacket ( final Player receiver , final PacketContainer packet , NetworkMarker marker , final boolean filters ) throws InvocationTargetException { } @ Override public void sendWirePacket ( Player receiver , int id , byte [ ] bytes ) throws InvocationTargetException { } @ Override public void sendWirePacket ( Player receiver , WirePacket packet ) throws InvocationTargetException { } @ Override public void recieveClientPacket ( Player sender , PacketContainer packet ) throws IllegalAccessException , InvocationTargetException { } @ Override public void recieveClientPacket ( Player sender , PacketContainer packet , boolean filters ) throws IllegalAccessException , InvocationTargetException { } @ Override public void recieveClientPacket ( Player sender , PacketContainer packet , NetworkMarker marker , boolean filters ) throws IllegalAccessException , InvocationTargetException { } @ Override @ Deprecated public PacketContainer createPacket ( int id ) { } @ Override public PacketContainer createPacket ( PacketType type ) { } @ Override @ Deprecated public PacketContainer createPacket ( int id , boolean forceDefaults ) { } @ Override public PacketContainer createPacket ( PacketType type , boolean forceDefaults ) { } @ Override @ Deprecated public PacketConstructor createPacketConstructor ( int id , Object ... arguments ) { } @ Override public PacketConstructor createPacketConstructor ( PacketType type , Object ... arguments ) { } @ Override @ Deprecated public Set < Integer > getSendingFilters ( ) { } @ Override public Set < Integer > getReceivingFilters ( ) { } @ Override public Set < PacketType > getSendingFilterTypes ( ) { } @ Override public Set < PacketType > getReceivingFilterTypes ( ) { } @ Override public void updateEntity ( Entity entity , List < Player > observers ) throws FieldAccessException { } @ Override public Entity getEntityFromID ( World container , int id ) throws FieldAccessException { } @ Override public List < Player > getEntityTrackers ( Entity entity ) throws FieldAccessException { } public void initializePlayers ( List < Player > players ) { }

Fix:
for ( Player player : Util . getOnlinePlayers ( ) ) {