Skip to content

Commit

Permalink
Iterate quests of fellow questers for edge case, per #1570
Browse files Browse the repository at this point in the history
  • Loading branch information
PikaMug committed Jan 18, 2021
1 parent 81bddd2 commit dcb0d8f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
11 changes: 6 additions & 5 deletions main/src/main/java/me/blackvein/quests/Quester.java
Expand Up @@ -4042,14 +4042,15 @@ public Set<String> dispatchMultiplayerEverything(final Quest quest, final Object
fun.apply(q, quest);
appliedQuestIDs.add(quest.getId());
}
} else {
q.getCurrentQuests().forEach((otherQuest, i) -> {
if (otherQuest.getStage(i).containsObjective(type)) {
}
q.getCurrentQuests().forEach((otherQuest, i) -> {
if (otherQuest.getStage(i).containsObjective(type)) {
if (!otherQuest.getOptions().canShareSameQuestOnly()) {
fun.apply(q, otherQuest);
appliedQuestIDs.add(otherQuest.getId());
}
});
}
}
});
}
}
} catch (final Exception e) {
Expand Down
Expand Up @@ -76,13 +76,13 @@ public void onBlockBreak(final BlockBreakEvent evt) {
quester.breakBlock(quest, blockItemStack);

// Multiplayer
if (!dispatchedQuestIDs.contains(quest.getId())) {
dispatchedQuestIDs.addAll(quester.dispatchMultiplayerEverything(quest, breakType,
(final Quester q, final Quest cq) -> {
q.breakBlock(cq, blockItemStack);
return null;
}));
}
dispatchedQuestIDs.addAll(quester.dispatchMultiplayerEverything(quest, breakType,
(final Quester q, final Quest cq) -> {
if (!dispatchedQuestIDs.contains(cq.getId())) {
q.breakBlock(cq, blockItemStack);
}
return null;
}));
}
}

Expand Down

0 comments on commit dcb0d8f

Please sign in to comment.