question: @ SuppressWarnings ( "unchecked" ) public static < T extends Packet > void registerOutListener ( final Class < T > type , Player player , Predicate < T > listener ) { NetworkManagerWrapper wrapper = wrapNetworkManager ( player ) ; wrapper . registerOutgoingListener ( type , listener ) ; }
target:  Register a listener for an incoming packet type. The type may be abstract. The listeners registered will be fired in the inverse order that they were registered; last fired first, and the first fired last (with the default server handler last). Listeners that return false will not fire any other handlers afterwards. Also, remember packets are handled in a separate thread! Make sure to use schedulers if you need to call Bukkit-related code, or just synchronize your listener implementation (avoid blocking). This method also requires that the player's network manager to be wrapper first. If it is not already wrapped, this will be done first. This only works for outgoing (client-bound) packets.