Iterate quests of fellow questers for edge case, per #1570

This commit is contained in:
PikaMug 2021-01-17 23:52:47 -05:00
parent 81bddd246c
commit dcb0d8f24e
2 changed files with 13 additions and 12 deletions

View File

@ -4042,14 +4042,15 @@ public class Quester implements Comparable<Quester> {
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) {

View File

@ -76,13 +76,13 @@ public class BlockListener implements Listener {
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;
}));
}
}