public static void incrementQuest(Player player, Event event) {
if (event == null || (event instanceof Cancellable && ((Cancellable) event).isCancelled()))
return;
if (hasQuest(player)) {
QuestProgress progress = getProfile(player.getName()).getProgress();
if (progress.isFullyCompleted())
return;
QuestIncrementEvent incrementEvent = new QuestIncrementEvent(QuestManager.getQuest(progress
.getQuestName()), player, event);
Bukkit.getPluginManager().callEvent(incrementEvent);
if (incrementEvent.isCancelled())
return;
progress.updateProgress(player, event);
if (progress.isStepCompleted()) {
progress.onStepCompletion();
progress.cycle();
}
}
}