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

Compare commits

...

2 Commits
1.4.0 ... 1.5.0

Author SHA1 Message Date
Auxilor
a93aac6b6f libreforge-updater 2023-08-31 16:59:46 +01:00
Auxilor
025a74048a Added on-complete 2023-08-31 16:57:13 +01:00
4 changed files with 17 additions and 3 deletions

View File

@@ -152,6 +152,7 @@ class Task(
if (newXp >= requiredXp) {
player.profile.write(hasCompletedKey, true)
template.onComplete?.trigger(player)
Bukkit.getPluginManager().callEvent(PlayerTaskCompleteEvent(player, template, quest))

View File

@@ -6,6 +6,7 @@ import com.willfp.eco.core.registry.KRegistrable
import com.willfp.ecoquests.quests.Quest
import com.willfp.libreforge.ViolationContext
import com.willfp.libreforge.counters.Counters
import com.willfp.libreforge.effects.Effects
class TaskTemplate(
private val plugin: EcoPlugin,
@@ -16,6 +17,11 @@ class TaskTemplate(
Counters.compile(it, ViolationContext(plugin, "task $id tasks"))
}
val onComplete = Effects.compileChain(
config.getSubsections("on-complete"),
ViolationContext(plugin, "task $id on-complete")
)
fun create(quest: Quest, xpExpr: String) =
Task(plugin, this, quest, xpExpr)
}

View File

@@ -21,3 +21,10 @@ xp-gain-methods:
filters:
blocks:
- stone
# An optional list of effects to run when a player completes the task
# Read here: https://plugins.auxilor.io/effects/configuring-an-effect
on-complete:
- id: send_message
args:
message: "Task Completed!"

View File

@@ -1,5 +1,5 @@
#libreforge-updater
#Wed Aug 30 11:31:41 BST 2023
#Thu Aug 31 16:59:46 BST 2023
kotlin.code.style=official
libreforge-version=4.32.0
version=1.4.0
libreforge-version=4.33.0
version=1.5.0