File tree 1 file changed +14
-3
lines changed
common/src/main/java/dev/ftb/mods/ftbquests/quest
1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -547,8 +547,8 @@ public boolean areDependenciesVisible(Quest quest) {
547
547
}
548
548
549
549
public boolean canStartTasks (Quest quest ) {
550
- return ! isExcludedByOtherQuestline (quest ) &&
551
- ( quest . getProgressionMode () == ProgressionMode . FLEXIBLE || areDependenciesComplete (quest ) );
550
+ return (quest . getProgressionMode () == ProgressionMode . FLEXIBLE || areDependenciesComplete ( quest ))
551
+ && ! isExcludedByOtherQuestline (quest );
552
552
}
553
553
554
554
public void claimReward (ServerPlayer player , Reward reward , boolean notify ) {
@@ -778,7 +778,18 @@ public LongSet getPinnedQuestIds(Player player) {
778
778
}
779
779
780
780
public boolean isExcludedByOtherQuestline (QuestObject qo ) {
781
- return qo instanceof Excludable e && exclusionCache .computeIfAbsent (e .getId (), k -> e .isQuestObjectExcluded (this ));
781
+ if (qo instanceof Excludable e ) {
782
+ // note: computeIfAbsent() won't work well here due to indirect recursion
783
+ // (can throw exception with both standard and fastutil maps)
784
+ if (exclusionCache .containsKey (e .getId ())) {
785
+ return exclusionCache .get (e .getId ());
786
+ }
787
+ boolean excluded = e .isQuestObjectExcluded (this );
788
+ exclusionCache .put (e .getId (), excluded );
789
+ return excluded ;
790
+
791
+ }
792
+ return false ;
782
793
}
783
794
784
795
private static class PerPlayerData {
You can’t perform that action at this time.
0 commit comments