@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);
}

@ 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 ) ; }
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 .
