Program: 10331
Project: 10331
Buggy source:
@EventHandler public void projectileHit(ProjectileHitEvent event){
  Player player=null;
  dNPC npc=null;
  if (event.getEntity() == null)   return;
  dEntity projectile=new dEntity(event.getEntity());
  if (projectile.getLocation() == null)   return;
  Block block=null;
  BlockIterator bi=new BlockIterator(projectile.getLocation().getWorld(),projectile.getLocation().toVector(),projectile.getLocation().getDirection().normalize(),0,4);
  while (bi.hasNext()) {
    block=bi.next();
    if (block.getTypeId() != 0) {
      break;
    }
  }
  if (block == null)   return;
  dEntity shooter=projectile.getShooter();
  dMaterial material=dMaterial.getMaterialFrom(block.getType(),block.getData());
  Map<String,dObject> context=new HashMap<String,dObject>();
  context.put("String_Node_Str",projectile);
  context.put("String_Node_Str",new dLocation(block.getLocation()));
  List<String> events=new ArrayList<String>();
  events.add("String_Node_Str");
  events.add("String_Node_Str" + material.identify());
  events.add(projectile.identifyType() + "String_Node_Str");
  events.add(projectile.identifyType() + "String_Node_Str" + material.identify());
  if (shooter != null) {
    context.put("String_Node_Str",shooter.getDenizenObject());
    if (shooter.isNPC()) {
      npc=shooter.getDenizenNPC();
    }
 else     if (shooter.isPlayer()) {
      player=shooter.getPlayer();
    }
    events.add("String_Node_Str");
    events.add("String_Node_Str" + projectile.identifyType());
    events.add("String_Node_Str" + material.identify() + "String_Node_Str"+ projectile.identifyType());
    events.add(shooter.identifyType() + "String_Node_Str");
    events.add(shooter.identifyType() + "String_Node_Str" + projectile.identifyType());
    events.add(shooter.identifyType() + "String_Node_Str" + material.identify()+ "String_Node_Str"+ projectile.identifyType());
  }
  EventManager.doEvents(events,npc,player,context,true);
}

Fixed version (ground truth):
@EventHandler public void projectileHit(ProjectileHitEvent event){
  Player player=null;
  dNPC npc=null;
  if (event.getEntity() == null)   return;
  dEntity projectile=new dEntity(event.getEntity());
  if (projectile.getLocation() == null)   return;
  if (Double.isNaN(projectile.getLocation().getDirection().normalize().getX()))   return;
  Block block=null;
  BlockIterator bi=new BlockIterator(projectile.getLocation().getWorld(),projectile.getLocation().toVector(),projectile.getLocation().getDirection().normalize(),0,4);
  while (bi.hasNext()) {
    block=bi.next();
    if (block.getTypeId() != 0) {
      break;
    }
  }
  if (block == null)   return;
  dEntity shooter=projectile.getShooter();
  dMaterial material=dMaterial.getMaterialFrom(block.getType(),block.getData());
  Map<String,dObject> context=new HashMap<String,dObject>();
  context.put("String_Node_Str",projectile);
  context.put("String_Node_Str",new dLocation(block.getLocation()));
  List<String> events=new ArrayList<String>();
  events.add("String_Node_Str");
  events.add("String_Node_Str" + material.identify());
  events.add(projectile.identifyType() + "String_Node_Str");
  events.add(projectile.identifyType() + "String_Node_Str" + material.identify());
  if (shooter != null) {
    context.put("String_Node_Str",shooter.getDenizenObject());
    if (shooter.isNPC()) {
      npc=shooter.getDenizenNPC();
    }
 else     if (shooter.isPlayer()) {
      player=shooter.getPlayer();
    }
    events.add("String_Node_Str");
    events.add("String_Node_Str" + projectile.identifyType());
    events.add("String_Node_Str" + material.identify() + "String_Node_Str"+ projectile.identifyType());
    events.add(shooter.identifyType() + "String_Node_Str");
    events.add(shooter.identifyType() + "String_Node_Str" + projectile.identifyType());
    events.add(shooter.identifyType() + "String_Node_Str" + material.identify()+ "String_Node_Str"+ projectile.identifyType());
  }
  EventManager.doEvents(events,npc,player,context,true);
}