9
0
mirror of https://github.com/Auxilor/EcoQuests.git synced 2025-12-21 16:09:16 +00:00

Compare commits

..

7 Commits

Author SHA1 Message Date
Will FP
c86651df9b libreforge-updater 2024-09-22 17:00:59 +01:00
Will FP
26ccae38b1 Merge pull request #4 from Exanthiax/improved_sorting
improved sorting and multi-line descriptions
2024-09-22 15:47:35 +01:00
Exanthiax
c1c985d638 improved sorting and multi-line descriptions 2024-09-22 15:12:11 +01:00
Auxilor
5e51c369bb libreforge-updater 2024-09-02 11:30:14 +01:00
Auxilor
67a2e2fb4f libreforge-updater 2024-08-30 17:25:13 +01:00
Auxilor
f94e79bc92 libreforge-updater 2024-08-29 12:09:23 +01:00
Auxilor
9cf8d465b9 libreforge-updater 2024-08-23 15:35:29 +01:00
2 changed files with 18 additions and 7 deletions

View File

@@ -101,12 +101,22 @@ class Quest(
// The tasks that are actually in use // The tasks that are actually in use
var tasks = run { var tasks = run {
if (taskAmount == availableTasks.size) {
// If taskAmount is equal to availableTasks.size then tasks are ordered as configured
if (isResettable) {
availableTasks.take(taskAmount)
} else {
availableTasks.shuffled().take(taskAmount)
}
} else {
// If taskAmount is less than availableTasks.size then tasks are selected and ordered randomly.
if (isResettable) { if (isResettable) {
loadTasks() ?: availableTasks.randomlyPick(taskAmount) loadTasks() ?: availableTasks.randomlyPick(taskAmount)
} else { } else {
availableTasks.randomlyPick(taskAmount) availableTasks.randomlyPick(taskAmount)
} }
} }
}
private set private set
private val hasStartedKey = PersistentDataKey( private val hasStartedKey = PersistentDataKey(
@@ -268,7 +278,8 @@ class Quest(
} }
fun getDescription(player: Player): List<String> { fun getDescription(player: Player): List<String> {
return addPlaceholdersInto(listOf(config.getString("description")), player) val descriptions = config.getStrings("description")
return addPlaceholdersInto(descriptions, player)
} }
fun hasActive(player: OfflinePlayer): Boolean { fun hasActive(player: OfflinePlayer): Boolean {

View File

@@ -1,5 +1,5 @@
#libreforge-updater #libreforge-updater
#Wed Aug 21 18:58:25 BST 2024 #Sun Sep 22 17:00:59 BST 2024
kotlin.code.style=official kotlin.code.style=official
libreforge-version=4.71.2 libreforge-version=4.72.0
version=1.42.2 version=1.43.0