Skip to content

Commit

Permalink
Merge pull request #763 from FTBTeam/1.19/dev
Browse files Browse the repository at this point in the history
1.19/dev
  • Loading branch information
desht authored Jan 27, 2025
2 parents bb9afba + e9adf26 commit 8d2f978
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1902.5.10]

### Fixed
* Fixed dependencies of quests in always-hidden chapters also always being hidden (even if in a different chapter)

## [1902.5.9]

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void addButtons(Panel panel) {

ClientQuestFile file = ClientQuestFile.INSTANCE;
for (QuestObjectBase objectBase : file.getAllObjects()) {
if (config.predicate.test(objectBase) && (file.canEdit() || (!(objectBase instanceof QuestObject qo) || qo.isVisible(file.self)))) {
if (config.predicate.test(objectBase) && (file.canEdit() || (!(objectBase instanceof QuestObject qo) || qo.isSearchable(file.self)))) {
list.add((T) objectBase);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ private void showList(Collection<QuestObject> c, boolean dependencies) {
}

for (QuestObject object : c) {
if (questScreen.file.canEdit() || object.isVisible(questScreen.file.self)) {
if (questScreen.file.canEdit() || object.isSearchable(questScreen.file.self)) {
MutableComponent title = object.getMutableTitle();
if (object.getQuestChapter() != null && object.getQuestChapter() != quest.getQuestChapter()) {
Component suffix = Component.literal(" [").append(object.getQuestChapter().getTitle()).append("]").withStyle(ChatFormatting.GRAY);
Expand Down
9 changes: 5 additions & 4 deletions common/src/main/java/dev/ftb/mods/ftbquests/quest/Quest.java
Original file line number Diff line number Diff line change
Expand Up @@ -632,10 +632,6 @@ public void move(Chapter to, double x, double y) {

@Override
public boolean isVisible(TeamData data) {
if (chapter.alwaysInvisible) {
return false;
}

if (invisible && !data.isCompleted(this)) {
if (invisibleUntilTasks == 0 || tasks.stream().filter(data::isCompleted).limit(invisibleUntilTasks).count() < invisibleUntilTasks) {
return false;
Expand All @@ -653,6 +649,11 @@ public boolean isVisible(TeamData data) {
return getDependencies().anyMatch(object -> object.isVisible(data));
}

@Override
public boolean isSearchable(TeamData data) {
return !chapter.alwaysInvisible && super.isSearchable(data);
}

@Override
public void clearCachedData() {
super.clearCachedData();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ public boolean isVisible(TeamData data) {
return true;
}

public boolean isSearchable(TeamData data) {
return isVisible(data);
}

public void onStarted(QuestProgressEventData<?> data) {
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ mod_id=ftbquests
archives_base_name=ftb-quests
minecraft_version=1.19.2
# Build time
mod_version=1902.5.9
mod_version=1902.5.10
maven_group=dev.ftb.mods
mod_author=FTB Team
# Curse release
Expand Down

0 comments on commit 8d2f978

Please sign in to comment.