mirror of
https://github.com/Auxilor/EcoQuests.git
synced 2025-12-22 16:39:21 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a93aac6b6f | ||
|
|
025a74048a |
@@ -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))
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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!"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user