9
0
mirror of https://github.com/Auxilor/EcoQuests.git synced 2026-01-06 15:52:00 +00:00

Fixed gui.enabled doing nothing

This commit is contained in:
Auxilor
2023-08-08 23:52:58 +01:00
parent 8869b97831
commit 36c660b18d
2 changed files with 8 additions and 1 deletions

View File

@@ -21,7 +21,7 @@ object PreviousQuestsGUI {
fun reload(plugin: EcoPlugin) {
val questAreaComponent = QuestAreaComponent(plugin.configYml.getSubsection("completed-gui.quest-area")) {
Quests.getCompletedQuests(it)
Quests.getShownCompletedQuests(it)
}
menu = menu(plugin.configYml.getInt("completed-gui.rows")) {

View File

@@ -23,6 +23,7 @@ object Quests : ConfigCategory("quest", "quests") {
fun getShownQuests(player: Player): List<Quest> {
return values()
.filter { it.showsInGui }
.filter { it.hasActive(player) || (it.alwaysInGUI && !it.hasCompleted(player)) }
}
@@ -35,5 +36,11 @@ object Quests : ConfigCategory("quest", "quests") {
return values()
.filter { it.hasCompleted(player) }
}
fun getShownCompletedQuests(player: Player): List<Quest> {
return values()
.filter { it.showsInGui }
.filter { it.hasCompleted(player) }
}
}