9
0
mirror of https://github.com/Auxilor/EcoJobs.git synced 2025-12-19 15:09:24 +00:00

Merge branch 'master' into level-up-effects

This commit is contained in:
Will FP
2025-03-29 14:17:28 +00:00
committed by GitHub
13 changed files with 69 additions and 0 deletions

View File

@@ -215,6 +215,18 @@ class Job(
NormalExecutorFactory.create(),
ViolationContext(plugin, "Job $id level-up-effects")
)
val joinEffects = Effects.compileChain(
config.getSubsections("join-effects"),
NormalExecutorFactory.create(),
ViolationContext(plugin, "Job $id join-effects")
)
val leaveEffects = Effects.compileChain(
config.getSubsections("leave-effects"),
NormalExecutorFactory.create(),
ViolationContext(plugin, "Job $id leave-effects")
)
override fun onRegister() {
jobXpGains.forEach { it.bind(JobXPAccumulator(this)) }

View File

@@ -2,6 +2,7 @@ package com.willfp.ecojobs.jobs
import com.willfp.ecojobs.api.event.PlayerJobJoinEvent
import com.willfp.ecojobs.api.event.PlayerJobLeaveEvent
import com.willfp.libreforge.toDispatcher
import org.bukkit.entity.Player
import org.bukkit.event.EventHandler
import org.bukkit.event.EventPriority
@@ -23,6 +24,7 @@ object PriceHandler : Listener {
}
price.pay(player)
job.joinEffects?.trigger(player.toDispatcher())
}
@EventHandler(
@@ -40,5 +42,6 @@ object PriceHandler : Listener {
}
price.pay(player)
job.leaveEffects?.trigger(player.toDispatcher())
}
}

View File

@@ -27,6 +27,13 @@ join-price:
# Reference with %join_lore%
join-lore: []
# A list of effects to run when the player joins the job.
# Read https://plugins.auxilor.io/effects/configuring-an-effect
join-effects:
- id: broadcast
args:
message: "&8» &a%player% &8joined the &6Miner &8job!"
# The price to leave this job (set to 0 to disable)
# Read here for more: https://plugins.auxilor.io/all-plugins/prices
leave-price:
@@ -39,6 +46,13 @@ leave-price:
leave-lore:
- " &8» This will cost %leave_price%"
# A list of effects to run when the player leaves the job.
# Read https://plugins.auxilor.io/effects/configuring-an-effect
leave-effects:
- id: send_message
args:
message: "&8» &8You left the &6Miner &8job!"
# There are two ways to specify level XP requirements:
# 1. A formula to calculate for infinite levels
# 2. A list of XP requirements for each level

View File

@@ -10,6 +10,8 @@ join-price:
type: coins
display: "&a$%value%"
join-effects: []
join-lore: []
leave-price:
@@ -17,6 +19,8 @@ leave-price:
type: coins
display: "&a$%value%"
leave-effects: []
leave-lore:
- ""

View File

@@ -10,6 +10,8 @@ join-price:
type: coins
display: "&a$%value%"
join-effects: []
join-lore: []
leave-price:
@@ -17,6 +19,8 @@ leave-price:
type: coins
display: "&a$%value%"
leave-effects: []
leave-lore:
- ""

View File

@@ -10,6 +10,8 @@ join-price:
type: coins
display: "&a$%value%"
join-effects: []
join-lore: []
leave-price:
@@ -17,6 +19,8 @@ leave-price:
type: coins
display: "&a$%value%"
leave-effects: []
leave-lore:
- ""

View File

@@ -10,6 +10,8 @@ join-price:
type: coins
display: "&a$%value%"
join-effects: []
join-lore: []
leave-price:
@@ -17,6 +19,8 @@ leave-price:
type: coins
display: "&a$%value%"
leave-effects: []
leave-lore:
- ""

View File

@@ -10,6 +10,8 @@ join-price:
type: coins
display: "&a$%value%"
join-effects: []
join-lore: []
leave-price:
@@ -17,6 +19,8 @@ leave-price:
type: coins
display: "&a$%value%"
leave-effects: []
leave-lore:
- ""

View File

@@ -10,6 +10,8 @@ join-price:
type: coins
display: "&a$%value%"
join-effects: []
join-lore: []
leave-price:
@@ -17,6 +19,8 @@ leave-price:
type: coins
display: "&a$%value%"
leave-effects: []
leave-lore:
- ""

View File

@@ -10,6 +10,8 @@ join-price:
type: coins
display: "&a$%value%"
join-effects: []
join-lore: []
leave-price:
@@ -17,6 +19,8 @@ leave-price:
type: coins
display: "&a$%value%"
leave-effects: []
leave-lore:
- ""

View File

@@ -10,6 +10,8 @@ join-price:
type: coins
display: "&a$%value%"
join-effects: []
join-lore: []
leave-price:
@@ -17,6 +19,8 @@ leave-price:
type: coins
display: "&a$%value%"
leave-effects: []
leave-lore:
- ""

View File

@@ -10,6 +10,8 @@ join-price:
type: coins
display: "&a$%value%"
join-effects: []
join-lore: []
leave-price:
@@ -17,6 +19,8 @@ leave-price:
type: coins
display: "&a$%value%"
leave-effects: []
leave-lore:
- ""

View File

@@ -18,6 +18,8 @@ join-price:
type: coins
display: "&a$%value%"
join-effects: []
join-lore: []
leave-price:
@@ -25,6 +27,8 @@ leave-price:
type: coins
display: "&a$%value%"
leave-effects: []
leave-lore:
- ""