Program: 34066
Project: 34066
Buggy source:
/** 
 * This method protects players from PVP if it is not allowed and from arrows fired by other players
 * @param e
 */
@EventHandler(priority=EventPriority.LOW,ignoreCancelled=true) public void onEntityDamage(final EntityDamageByEntityEvent e){
  if (debug) {
    plugin.getLogger().info(e.getEventName());
    plugin.getLogger().info(e.getDamager().toString());
  }
  if (e.getDamager() instanceof EnderPearl) {
    return;
  }
  if (!inWorld(e.getEntity())) {
    return;
  }
  if (!Settings.allowTNTDamage && e.getDamager().getType().equals(EntityType.PRIMED_TNT)) {
    e.setCancelled(true);
    return;
  }
  if (!Settings.allowCreeperDamage && e.getDamager().getType().equals(EntityType.CREEPER) && !(e.getEntity() instanceof Player)) {
    e.setCancelled(true);
    return;
  }
  if (e.getDamager() instanceof Player) {
    Player p=(Player)e.getDamager();
    if (p.isOp() || VaultHelper.checkPerm(p,Settings.PERMPREFIX + "String_Node_Str")) {
      return;
    }
  }
  if (e.getEntity() instanceof ItemFrame) {
    if (!Settings.allowSpawnBreakBlocks && plugin.getGrid().isAtSpawn(e.getEntity().getLocation())) {
      Player player=(Player)e.getDamager();
      player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).islandProtected);
      e.setCancelled(true);
      return;
    }
    if (Settings.allowBreakBlocks || (Settings.allowSpawnBreakBlocks && plugin.getGrid().isAtSpawn(e.getEntity().getLocation()))) {
      return;
    }
    if (e.getDamager() instanceof Player) {
      if (!plugin.getGrid().locationIsOnIsland((Player)e.getDamager(),e.getEntity().getLocation())) {
        Player player=(Player)e.getDamager();
        player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).islandProtected);
        e.setCancelled(true);
        return;
      }
    }
 else     if (e.getDamager() instanceof Projectile) {
      Projectile p=(Projectile)e.getDamager();
      if (p.getShooter() instanceof Player) {
        if (!plugin.getGrid().locationIsOnIsland((Player)p.getShooter(),e.getEntity().getLocation())) {
          Player player=(Player)p.getShooter();
          player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).islandProtected);
          e.setCancelled(true);
          return;
        }
      }
    }
 else     if ((e.getDamager() instanceof TNTPrimed) && !Settings.allowTNTDamage) {
      e.setCancelled(true);
      return;
    }
  }
  if (!(e.getDamager() instanceof Player) && !(e.getDamager() instanceof Projectile)) {
    return;
  }
  if (e.getDamager() instanceof Player) {
    if (!(e.getEntity() instanceof Player)) {
      Location targetLoc=e.getEntity().getLocation();
      if (e.getEntity() instanceof Monster || e.getEntity() instanceof Slime || e.getEntity() instanceof Squid) {
        if (plugin.getGrid().isAtSpawn(targetLoc)) {
          if (!Settings.allowSpawnMobKilling) {
            Player player=(Player)e.getDamager();
            player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).islandProtected);
            e.setCancelled(true);
            return;
          }
          return;
        }
        if (!plugin.getGrid().locationIsOnIsland((Player)e.getDamager(),e.getEntity().getLocation())) {
          if (!Settings.allowHurtMonsters) {
            Player player=(Player)e.getDamager();
            player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).islandProtected);
            e.setCancelled(true);
            return;
          }
        }
        return;
      }
      if (e.getEntity() instanceof Animals) {
        if (plugin.getGrid().isAtSpawn(e.getEntity().getLocation())) {
          if (!Settings.allowSpawnAnimalKilling) {
            Player player=(Player)e.getDamager();
            player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).islandProtected);
            e.setCancelled(true);
            return;
          }
          return;
        }
        if (!Settings.allowHurtMobs) {
          if (!plugin.getGrid().locationIsOnIsland((Player)e.getDamager(),e.getEntity().getLocation())) {
            Player player=(Player)e.getDamager();
            player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).islandProtected);
            e.setCancelled(true);
            return;
          }
        }
        return;
      }
switch (e.getEntityType()) {
case IRON_GOLEM:
case SNOWMAN:
case VILLAGER:
        if (!Settings.allowHurtMobs) {
          if (!plugin.getGrid().locationIsOnIsland((Player)e.getDamager(),e.getEntity().getLocation())) {
            Player player=(Player)e.getDamager();
            player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).islandProtected);
            e.setCancelled(true);
            return;
          }
        }
      break;
default :
    break;
}
return;
}
 else {
if (Settings.allowPvP) {
  return;
}
}
}
if (e.getDamager() instanceof Projectile) {
Projectile projectile=(Projectile)e.getDamager();
if (projectile.getShooter() instanceof Player) {
Player shooter=(Player)projectile.getShooter();
if (e.getEntity() instanceof Player) {
  if (shooter.equals((Player)e.getEntity())) {
    return;
  }
  if (!Settings.allowPvP) {
    shooter.sendMessage(ChatColor.RED + plugin.myLocale(shooter.getUniqueId()).targetInNoPVPArea);
    e.setCancelled(true);
    return;
  }
}
 else {
  if (!(e.getEntity() instanceof Monster) && !(e.getEntity() instanceof Slime) && !(e.getEntity() instanceof Squid)) {
    if (!Settings.allowHurtMobs) {
      if (!plugin.getGrid().locationIsOnIsland((Player)projectile.getShooter(),e.getEntity().getLocation())) {
        shooter.sendMessage(ChatColor.RED + plugin.myLocale(shooter.getUniqueId()).islandProtected);
        e.setCancelled(true);
        return;
      }
    }
    return;
  }
 else {
    if (!Settings.allowHurtMonsters) {
      if (!plugin.getGrid().locationIsOnIsland((Player)e.getDamager(),e.getEntity().getLocation())) {
        Player player=(Player)e.getDamager();
        player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).islandProtected);
        e.setCancelled(true);
        return;
      }
    }
  }
}
}
}
 else if (e.getDamager() instanceof Player) {
if (!Settings.allowPvP) {
Player player=(Player)e.getDamager();
player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).targetInNoPVPArea);
e.setCancelled(true);
return;
}
}
return;
}

Fixed version (ground truth):
/** 
 * This method protects players from PVP if it is not allowed and from arrows fired by other players
 * @param e
 */
@EventHandler(priority=EventPriority.LOW,ignoreCancelled=true) public void onEntityDamage(final EntityDamageByEntityEvent e){
  if (debug) {
    plugin.getLogger().info(e.getEventName());
    plugin.getLogger().info(e.getDamager().toString());
  }
  if (e.getDamager() instanceof EnderPearl) {
    return;
  }
  if (!inWorld(e.getEntity())) {
    return;
  }
  if (!Settings.allowTNTDamage && e.getDamager().getType().equals(EntityType.PRIMED_TNT)) {
    e.setCancelled(true);
    return;
  }
  if (!Settings.allowCreeperDamage && e.getDamager().getType().equals(EntityType.CREEPER) && !(e.getEntity() instanceof Player)) {
    e.setCancelled(true);
    return;
  }
  if (e.getDamager() instanceof Player) {
    Player p=(Player)e.getDamager();
    if (p.isOp() || VaultHelper.checkPerm(p,Settings.PERMPREFIX + "String_Node_Str")) {
      return;
    }
  }
  if (e.getEntity() instanceof ItemFrame) {
    if (!Settings.allowSpawnBreakBlocks && plugin.getGrid().isAtSpawn(e.getEntity().getLocation())) {
      Player player=(Player)e.getDamager();
      player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).islandProtected);
      e.setCancelled(true);
      return;
    }
    if (Settings.allowBreakBlocks || (Settings.allowSpawnBreakBlocks && plugin.getGrid().isAtSpawn(e.getEntity().getLocation()))) {
      return;
    }
    if (e.getDamager() instanceof Player) {
      if (!plugin.getGrid().locationIsOnIsland((Player)e.getDamager(),e.getEntity().getLocation())) {
        Player player=(Player)e.getDamager();
        player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).islandProtected);
        e.setCancelled(true);
        return;
      }
    }
 else     if (e.getDamager() instanceof Projectile) {
      Projectile p=(Projectile)e.getDamager();
      if (p.getShooter() instanceof Player) {
        if (!plugin.getGrid().locationIsOnIsland((Player)p.getShooter(),e.getEntity().getLocation())) {
          Player player=(Player)p.getShooter();
          player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).islandProtected);
          e.setCancelled(true);
          return;
        }
      }
    }
 else     if ((e.getDamager() instanceof TNTPrimed) && !Settings.allowTNTDamage) {
      e.setCancelled(true);
      return;
    }
  }
  if (!(e.getDamager() instanceof Player) && !(e.getDamager() instanceof Projectile)) {
    return;
  }
  if (e.getDamager() instanceof Player) {
    if (!(e.getEntity() instanceof Player)) {
      Location targetLoc=e.getEntity().getLocation();
      if (e.getEntity() instanceof Monster || e.getEntity() instanceof Slime || e.getEntity() instanceof Squid) {
        if (plugin.getGrid().isAtSpawn(targetLoc)) {
          if (!Settings.allowSpawnMobKilling) {
            Player player=(Player)e.getDamager();
            player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).islandProtected);
            e.setCancelled(true);
            return;
          }
          return;
        }
        if (!plugin.getGrid().locationIsOnIsland((Player)e.getDamager(),e.getEntity().getLocation())) {
          if (!Settings.allowHurtMonsters) {
            Player player=(Player)e.getDamager();
            player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).islandProtected);
            e.setCancelled(true);
            return;
          }
        }
        return;
      }
      if (e.getEntity() instanceof Animals) {
        if (plugin.getGrid().isAtSpawn(e.getEntity().getLocation())) {
          if (!Settings.allowSpawnAnimalKilling) {
            Player player=(Player)e.getDamager();
            player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).islandProtected);
            e.setCancelled(true);
            return;
          }
          return;
        }
        if (!Settings.allowHurtMobs) {
          if (!plugin.getGrid().locationIsOnIsland((Player)e.getDamager(),e.getEntity().getLocation())) {
            Player player=(Player)e.getDamager();
            player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).islandProtected);
            e.setCancelled(true);
            return;
          }
        }
        return;
      }
switch (e.getEntityType()) {
case IRON_GOLEM:
case SNOWMAN:
case VILLAGER:
        if (!Settings.allowHurtMobs) {
          if (!plugin.getGrid().locationIsOnIsland((Player)e.getDamager(),e.getEntity().getLocation())) {
            Player player=(Player)e.getDamager();
            player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).islandProtected);
            e.setCancelled(true);
            return;
          }
        }
      break;
default :
    break;
}
return;
}
 else {
if (Settings.allowPvP) {
  return;
}
}
}
if (e.getDamager() instanceof Projectile) {
Projectile projectile=(Projectile)e.getDamager();
if (projectile.getShooter() instanceof Player) {
Player shooter=(Player)projectile.getShooter();
if (e.getEntity() instanceof Player) {
  if (shooter.equals((Player)e.getEntity())) {
    return;
  }
  if (!Settings.allowPvP) {
    shooter.sendMessage(ChatColor.RED + plugin.myLocale(shooter.getUniqueId()).targetInNoPVPArea);
    e.setCancelled(true);
    return;
  }
}
 else {
  if (!(e.getEntity() instanceof Monster) && !(e.getEntity() instanceof Slime) && !(e.getEntity() instanceof Squid)) {
    if (!Settings.allowHurtMobs) {
      if (!plugin.getGrid().locationIsOnIsland((Player)projectile.getShooter(),e.getEntity().getLocation())) {
        shooter.sendMessage(ChatColor.RED + plugin.myLocale(shooter.getUniqueId()).islandProtected);
        e.setCancelled(true);
        return;
      }
    }
    return;
  }
 else {
    if (!Settings.allowHurtMonsters) {
      if (!plugin.getGrid().locationIsOnIsland(shooter,e.getEntity().getLocation())) {
        shooter.sendMessage(ChatColor.RED + plugin.myLocale(shooter.getUniqueId()).islandProtected);
        e.setCancelled(true);
        return;
      }
    }
  }
}
}
}
 else if (e.getDamager() instanceof Player) {
if (!Settings.allowPvP) {
Player player=(Player)e.getDamager();
player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).targetInNoPVPArea);
e.setCancelled(true);
return;
}
}
return;
}