mirror of
https://github.com/Auxilor/EcoQuests.git
synced 2025-12-21 16:09:16 +00:00
Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
779f942454 | ||
|
|
abad5bdfbd | ||
|
|
588839fc97 | ||
|
|
1c36c4b18f | ||
|
|
0460f1f6bf | ||
|
|
5814587ed5 | ||
|
|
f4682214cc | ||
|
|
3c0d5651d8 | ||
|
|
c86651df9b | ||
|
|
26ccae38b1 | ||
|
|
c1c985d638 | ||
|
|
ed947b354f | ||
|
|
5e51c369bb | ||
|
|
67a2e2fb4f | ||
|
|
f94e79bc92 | ||
|
|
9cf8d465b9 | ||
|
|
237ebda870 | ||
|
|
ed6bcaab04 | ||
|
|
40a0f99716 | ||
|
|
a59bce65ab | ||
|
|
0212076fad | ||
|
|
c4b0429ad5 | ||
|
|
c5e0611a20 | ||
|
|
cb2e8a181f | ||
|
|
c40a304c8a | ||
|
|
9e7a8a7581 |
@@ -1,9 +1,11 @@
|
||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||
|
||||
plugins {
|
||||
java
|
||||
`java-library`
|
||||
`maven-publish`
|
||||
kotlin("jvm") version "1.9.20"
|
||||
id("io.github.goooler.shadow") version "8.1.7"
|
||||
kotlin("jvm") version "2.1.0"
|
||||
id("com.gradleup.shadow") version "8.3.0"
|
||||
id("com.willfp.libreforge-gradle-plugin") version "1.0.0"
|
||||
}
|
||||
|
||||
@@ -25,7 +27,7 @@ allprojects {
|
||||
apply(plugin = "java")
|
||||
apply(plugin = "kotlin")
|
||||
apply(plugin = "maven-publish")
|
||||
apply(plugin = "io.github.goooler.shadow")
|
||||
apply(plugin = "com.gradleup.shadow")
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
@@ -39,12 +41,12 @@ allprojects {
|
||||
dependencies {
|
||||
compileOnly("com.willfp:eco:6.65.0")
|
||||
compileOnly("org.jetbrains:annotations:23.0.0")
|
||||
compileOnly("org.jetbrains.kotlin:kotlin-stdlib:1.9.20")
|
||||
compileOnly("org.jetbrains.kotlin:kotlin-stdlib:2.1.0")
|
||||
}
|
||||
|
||||
java {
|
||||
withSourcesJar()
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
||||
}
|
||||
|
||||
tasks {
|
||||
@@ -54,8 +56,8 @@ allprojects {
|
||||
}
|
||||
|
||||
compileKotlin {
|
||||
kotlinOptions {
|
||||
jvmTarget = "21"
|
||||
compilerOptions {
|
||||
jvmTarget.set(JvmTarget.JVM_17)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -101,10 +101,20 @@ class Quest(
|
||||
|
||||
// The tasks that are actually in use
|
||||
var tasks = run {
|
||||
if (isResettable) {
|
||||
loadTasks() ?: availableTasks.randomlyPick(taskAmount)
|
||||
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 {
|
||||
availableTasks.randomlyPick(taskAmount)
|
||||
// If taskAmount is less than availableTasks.size then tasks are selected and ordered randomly.
|
||||
if (isResettable) {
|
||||
loadTasks() ?: availableTasks.randomlyPick(taskAmount)
|
||||
} else {
|
||||
availableTasks.randomlyPick(taskAmount)
|
||||
}
|
||||
}
|
||||
}
|
||||
private set
|
||||
@@ -268,7 +278,8 @@ class Quest(
|
||||
}
|
||||
|
||||
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 {
|
||||
|
||||
@@ -146,6 +146,11 @@ class Task(
|
||||
* Give experience directly
|
||||
*/
|
||||
fun giveExperience(player: Player, amount: Double) {
|
||||
|
||||
if (player.profile.read(hasCompletedKey)) {
|
||||
return
|
||||
}
|
||||
|
||||
val requiredXp = getExperienceRequired(player)
|
||||
val newXp = player.profile.read(xpKey) + amount
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#libreforge-updater
|
||||
#Fri Jul 05 13:02:51 BST 2024
|
||||
#Sat Mar 29 14:22:27 GMT 2025
|
||||
kotlin.code.style=official
|
||||
libreforge-version=4.64.1
|
||||
version=1.35.1
|
||||
libreforge-version=4.75.0
|
||||
version=1.46.0
|
||||
|
||||
Reference in New Issue
Block a user