class EntityListener implements Listener {

    @EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST)
    public void onProjectileLaunch(ProjectileLaunchEvent event) {
        if (event.getEntity() == null) {
            return;
        }

        Projectile projectile = event.getEntity();
        // In the Bukkit API prior to 1.7, getShooter() returns a LivingEntity instead of a ProjectileSource
        Object shooterRaw = null;
        if (shooterIsLivingEntity) {
            try {
                if (getShooter == null) {
                    getShooter = Projectile.class.getMethod("getShooter");
                }
                shooterRaw = getShooter.invoke(projectile);
            } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) {
                ConsoleLogger.logException("Error getting shooter", e);
            }
        } else {
            shooterRaw = projectile.getShooter();
        }
        if (shooterRaw instanceof Player && listenerService.shouldCancelEvent((Player) shooterRaw)) {
            event.setCancelled(true);
        }
    }

    @Inject  EntityListener(ListenerService listenerService);

}