mirror of
https://github.com/Auxilor/EcoJobs.git
synced 2025-12-20 07:29:20 +00:00
Merge branch 'master' into level-up-effects
This commit is contained in:
@@ -215,6 +215,18 @@ class Job(
|
|||||||
NormalExecutorFactory.create(),
|
NormalExecutorFactory.create(),
|
||||||
ViolationContext(plugin, "Job $id level-up-effects")
|
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() {
|
override fun onRegister() {
|
||||||
jobXpGains.forEach { it.bind(JobXPAccumulator(this)) }
|
jobXpGains.forEach { it.bind(JobXPAccumulator(this)) }
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.willfp.ecojobs.jobs
|
|||||||
|
|
||||||
import com.willfp.ecojobs.api.event.PlayerJobJoinEvent
|
import com.willfp.ecojobs.api.event.PlayerJobJoinEvent
|
||||||
import com.willfp.ecojobs.api.event.PlayerJobLeaveEvent
|
import com.willfp.ecojobs.api.event.PlayerJobLeaveEvent
|
||||||
|
import com.willfp.libreforge.toDispatcher
|
||||||
import org.bukkit.entity.Player
|
import org.bukkit.entity.Player
|
||||||
import org.bukkit.event.EventHandler
|
import org.bukkit.event.EventHandler
|
||||||
import org.bukkit.event.EventPriority
|
import org.bukkit.event.EventPriority
|
||||||
@@ -23,6 +24,7 @@ object PriceHandler : Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
price.pay(player)
|
price.pay(player)
|
||||||
|
job.joinEffects?.trigger(player.toDispatcher())
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(
|
@EventHandler(
|
||||||
@@ -40,5 +42,6 @@ object PriceHandler : Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
price.pay(player)
|
price.pay(player)
|
||||||
|
job.leaveEffects?.trigger(player.toDispatcher())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,13 @@ join-price:
|
|||||||
# Reference with %join_lore%
|
# Reference with %join_lore%
|
||||||
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)
|
# The price to leave this job (set to 0 to disable)
|
||||||
# Read here for more: https://plugins.auxilor.io/all-plugins/prices
|
# Read here for more: https://plugins.auxilor.io/all-plugins/prices
|
||||||
leave-price:
|
leave-price:
|
||||||
@@ -39,6 +46,13 @@ leave-price:
|
|||||||
leave-lore:
|
leave-lore:
|
||||||
- " &8» This will cost %leave_price%"
|
- " &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:
|
# There are two ways to specify level XP requirements:
|
||||||
# 1. A formula to calculate for infinite levels
|
# 1. A formula to calculate for infinite levels
|
||||||
# 2. A list of XP requirements for each level
|
# 2. A list of XP requirements for each level
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ join-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
join-effects: []
|
||||||
|
|
||||||
join-lore: []
|
join-lore: []
|
||||||
|
|
||||||
leave-price:
|
leave-price:
|
||||||
@@ -17,6 +19,8 @@ leave-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
leave-effects: []
|
||||||
|
|
||||||
leave-lore:
|
leave-lore:
|
||||||
- ""
|
- ""
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ join-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
join-effects: []
|
||||||
|
|
||||||
join-lore: []
|
join-lore: []
|
||||||
|
|
||||||
leave-price:
|
leave-price:
|
||||||
@@ -17,6 +19,8 @@ leave-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
leave-effects: []
|
||||||
|
|
||||||
leave-lore:
|
leave-lore:
|
||||||
- ""
|
- ""
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ join-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
join-effects: []
|
||||||
|
|
||||||
join-lore: []
|
join-lore: []
|
||||||
|
|
||||||
leave-price:
|
leave-price:
|
||||||
@@ -17,6 +19,8 @@ leave-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
leave-effects: []
|
||||||
|
|
||||||
leave-lore:
|
leave-lore:
|
||||||
- ""
|
- ""
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ join-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
join-effects: []
|
||||||
|
|
||||||
join-lore: []
|
join-lore: []
|
||||||
|
|
||||||
leave-price:
|
leave-price:
|
||||||
@@ -17,6 +19,8 @@ leave-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
leave-effects: []
|
||||||
|
|
||||||
leave-lore:
|
leave-lore:
|
||||||
- ""
|
- ""
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ join-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
join-effects: []
|
||||||
|
|
||||||
join-lore: []
|
join-lore: []
|
||||||
|
|
||||||
leave-price:
|
leave-price:
|
||||||
@@ -17,6 +19,8 @@ leave-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
leave-effects: []
|
||||||
|
|
||||||
leave-lore:
|
leave-lore:
|
||||||
- ""
|
- ""
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ join-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
join-effects: []
|
||||||
|
|
||||||
join-lore: []
|
join-lore: []
|
||||||
|
|
||||||
leave-price:
|
leave-price:
|
||||||
@@ -17,6 +19,8 @@ leave-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
leave-effects: []
|
||||||
|
|
||||||
leave-lore:
|
leave-lore:
|
||||||
- ""
|
- ""
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ join-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
join-effects: []
|
||||||
|
|
||||||
join-lore: []
|
join-lore: []
|
||||||
|
|
||||||
leave-price:
|
leave-price:
|
||||||
@@ -17,6 +19,8 @@ leave-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
leave-effects: []
|
||||||
|
|
||||||
leave-lore:
|
leave-lore:
|
||||||
- ""
|
- ""
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ join-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
join-effects: []
|
||||||
|
|
||||||
join-lore: []
|
join-lore: []
|
||||||
|
|
||||||
leave-price:
|
leave-price:
|
||||||
@@ -17,6 +19,8 @@ leave-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
leave-effects: []
|
||||||
|
|
||||||
leave-lore:
|
leave-lore:
|
||||||
- ""
|
- ""
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ join-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
join-effects: []
|
||||||
|
|
||||||
join-lore: []
|
join-lore: []
|
||||||
|
|
||||||
leave-price:
|
leave-price:
|
||||||
@@ -17,6 +19,8 @@ leave-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
leave-effects: []
|
||||||
|
|
||||||
leave-lore:
|
leave-lore:
|
||||||
- ""
|
- ""
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ join-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
join-effects: []
|
||||||
|
|
||||||
join-lore: []
|
join-lore: []
|
||||||
|
|
||||||
leave-price:
|
leave-price:
|
||||||
@@ -25,6 +27,8 @@ leave-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
leave-effects: []
|
||||||
|
|
||||||
leave-lore:
|
leave-lore:
|
||||||
- ""
|
- ""
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user