mirror of
https://github.com/Auxilor/EcoJobs.git
synced 2025-12-21 16:09:18 +00:00
Added %join_lore% and %leave_lore%
This commit is contained in:
@@ -259,6 +259,24 @@ class Job(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun getLeaveLore(level: Int, whitespace: Int = 0): List<String> =
|
||||||
|
this.config.getStrings("leave-lore")
|
||||||
|
.map {
|
||||||
|
levelPlaceholders.format(it, level)
|
||||||
|
}
|
||||||
|
.map {
|
||||||
|
" ".repeat(whitespace) + it
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getJoinLore(level: Int, whitespace: Int = 0): List<String> =
|
||||||
|
this.config.getStrings("join-lore")
|
||||||
|
.map {
|
||||||
|
levelPlaceholders.format(it, level)
|
||||||
|
}
|
||||||
|
.map {
|
||||||
|
" ".repeat(whitespace) + it
|
||||||
|
}
|
||||||
|
|
||||||
fun injectPlaceholdersInto(lore: List<String>, player: Player, forceLevel: Int? = null): List<String> {
|
fun injectPlaceholdersInto(lore: List<String>, player: Player, forceLevel: Int? = null): List<String> {
|
||||||
val withPlaceholders = lore
|
val withPlaceholders = lore
|
||||||
.map {
|
.map {
|
||||||
@@ -292,6 +310,10 @@ class Job(
|
|||||||
getRewardsDescription(forceLevel ?: player.getJobLevel(this), whitespace)
|
getRewardsDescription(forceLevel ?: player.getJobLevel(this), whitespace)
|
||||||
} else if (s.contains("%level_up_messages%")) {
|
} else if (s.contains("%level_up_messages%")) {
|
||||||
getLevelUpMessages(forceLevel ?: player.getJobLevel(this), whitespace)
|
getLevelUpMessages(forceLevel ?: player.getJobLevel(this), whitespace)
|
||||||
|
} else if (s.contains("%leave_lore%")) {
|
||||||
|
getLeaveLore(forceLevel ?: player.getJobLevel(this), whitespace)
|
||||||
|
} else if (s.contains("%join_lore%")) {
|
||||||
|
getJoinLore(forceLevel ?: player.getJobLevel(this), whitespace)
|
||||||
} else {
|
} else {
|
||||||
listOf(s)
|
listOf(s)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,14 +66,14 @@ class JobLeaveGUI(
|
|||||||
plugin.langYml.getMessage("left-job")
|
plugin.langYml.getMessage("left-job")
|
||||||
.replace("%job%", job.name)
|
.replace("%job%", job.name)
|
||||||
)
|
)
|
||||||
player.closeInventory()
|
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
plugin.langYml.getMessage("cant-leave-job")
|
plugin.langYml.getMessage("cant-leave-job")
|
||||||
.replace("%job%", job.name)
|
.replace("%job%", job.name)
|
||||||
)
|
)
|
||||||
JobsGUI.open(player)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JobsGUI.open(player)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ leave-gui:
|
|||||||
name: "&cLeave %job%"
|
name: "&cLeave %job%"
|
||||||
lore:
|
lore:
|
||||||
- ""
|
- ""
|
||||||
- "&8» This will cost %leave_price%"
|
- "%leave_lore%"
|
||||||
location:
|
location:
|
||||||
row: 2
|
row: 2
|
||||||
column: 7
|
column: 7
|
||||||
|
|||||||
@@ -16,18 +16,29 @@ unlocked-by-default: true
|
|||||||
# If job progress should be reset when quitting
|
# If job progress should be reset when quitting
|
||||||
reset-on-quit: false
|
reset-on-quit: false
|
||||||
|
|
||||||
# The price to join or leave this job (set to 0 to disable)
|
# The price to join 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
|
||||||
join-price:
|
join-price:
|
||||||
value: 0
|
value: 0
|
||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
# Lore shown when clicking on the job icon to join it
|
||||||
|
# Reference with %join_lore%
|
||||||
|
join-lore: []
|
||||||
|
|
||||||
|
# The price to leave this job (set to 0 to disable)
|
||||||
|
# Read here for more: https://plugins.auxilor.io/all-plugins/prices
|
||||||
leave-price:
|
leave-price:
|
||||||
value: 0
|
value: 20000
|
||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
# Lore shown on the confirm leave button
|
||||||
|
# Reference with %leave_lore%
|
||||||
|
leave-lore:
|
||||||
|
- " &8» This will cost %leave_price%"
|
||||||
|
|
||||||
# The xp requirements for each job level - add new levels by adding more to this list
|
# The xp requirements for each job level - add new levels by adding more to this list
|
||||||
level-xp-requirements:
|
level-xp-requirements:
|
||||||
- 100
|
- 100
|
||||||
|
|||||||
@@ -10,11 +10,16 @@ join-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
join-lore: []
|
||||||
|
|
||||||
leave-price:
|
leave-price:
|
||||||
value: 0
|
value: 0
|
||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
leave-lore:
|
||||||
|
- ""
|
||||||
|
|
||||||
level-xp-requirements:
|
level-xp-requirements:
|
||||||
- 100
|
- 100
|
||||||
- 120
|
- 120
|
||||||
|
|||||||
@@ -10,11 +10,16 @@ join-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
join-lore: []
|
||||||
|
|
||||||
leave-price:
|
leave-price:
|
||||||
value: 0
|
value: 0
|
||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
leave-lore:
|
||||||
|
- ""
|
||||||
|
|
||||||
level-xp-requirements:
|
level-xp-requirements:
|
||||||
- 100
|
- 100
|
||||||
- 120
|
- 120
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
name: "A54FBEnchanter"
|
name: "A54FBEnchanter"
|
||||||
description: "&7&oLevel up by enchanting items"
|
description: "&8&oLevel up by enchanting items"
|
||||||
|
|
||||||
unlocked-by-default: true
|
unlocked-by-default: true
|
||||||
|
|
||||||
@@ -10,11 +10,16 @@ join-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
join-lore: []
|
||||||
|
|
||||||
leave-price:
|
leave-price:
|
||||||
value: 0
|
value: 0
|
||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
leave-lore:
|
||||||
|
- ""
|
||||||
|
|
||||||
level-xp-requirements:
|
level-xp-requirements:
|
||||||
- 100
|
- 100
|
||||||
- 120
|
- 120
|
||||||
|
|||||||
@@ -10,11 +10,16 @@ join-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
join-lore: []
|
||||||
|
|
||||||
leave-price:
|
leave-price:
|
||||||
value: 0
|
value: 0
|
||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
leave-lore:
|
||||||
|
- ""
|
||||||
|
|
||||||
level-xp-requirements:
|
level-xp-requirements:
|
||||||
- 100
|
- 100
|
||||||
- 120
|
- 120
|
||||||
|
|||||||
@@ -10,11 +10,16 @@ join-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
join-lore: []
|
||||||
|
|
||||||
leave-price:
|
leave-price:
|
||||||
value: 0
|
value: 0
|
||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
leave-lore:
|
||||||
|
- ""
|
||||||
|
|
||||||
level-xp-requirements:
|
level-xp-requirements:
|
||||||
- 100
|
- 100
|
||||||
- 120
|
- 120
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
name: "&#FB8810Lumberjack"
|
name: "&#FB8810Lumberjack"
|
||||||
description: "&7&oLevel up by chopping wood"
|
description: "&8&oLevel up by chopping wood"
|
||||||
|
|
||||||
unlocked-by-default: true
|
unlocked-by-default: true
|
||||||
|
|
||||||
@@ -10,11 +10,16 @@ join-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
join-lore: []
|
||||||
|
|
||||||
leave-price:
|
leave-price:
|
||||||
value: 0
|
value: 0
|
||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
leave-lore:
|
||||||
|
- ""
|
||||||
|
|
||||||
level-xp-requirements:
|
level-xp-requirements:
|
||||||
- 100
|
- 100
|
||||||
- 120
|
- 120
|
||||||
|
|||||||
@@ -10,11 +10,16 @@ join-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
join-lore: []
|
||||||
|
|
||||||
leave-price:
|
leave-price:
|
||||||
value: 0
|
value: 0
|
||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
leave-lore:
|
||||||
|
- ""
|
||||||
|
|
||||||
level-xp-requirements:
|
level-xp-requirements:
|
||||||
- 100
|
- 100
|
||||||
- 120
|
- 120
|
||||||
|
|||||||
@@ -10,11 +10,16 @@ join-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
join-lore: []
|
||||||
|
|
||||||
leave-price:
|
leave-price:
|
||||||
value: 0
|
value: 0
|
||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
leave-lore:
|
||||||
|
- ""
|
||||||
|
|
||||||
level-xp-requirements:
|
level-xp-requirements:
|
||||||
- 100
|
- 100
|
||||||
- 120
|
- 120
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
name: "B4736Smelter"
|
name: "B4736Smelter"
|
||||||
description: "&7&oLevel up by smelting items"
|
description: "&8&oLevel up by smelting items"
|
||||||
|
|
||||||
unlocked-by-default: true
|
unlocked-by-default: true
|
||||||
|
|
||||||
@@ -10,11 +10,16 @@ join-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
join-lore: []
|
||||||
|
|
||||||
leave-price:
|
leave-price:
|
||||||
value: 0
|
value: 0
|
||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
leave-lore:
|
||||||
|
- ""
|
||||||
|
|
||||||
level-xp-requirements:
|
level-xp-requirements:
|
||||||
- 100
|
- 100
|
||||||
- 120
|
- 120
|
||||||
|
|||||||
@@ -18,11 +18,16 @@ join-price:
|
|||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
join-lore: []
|
||||||
|
|
||||||
leave-price:
|
leave-price:
|
||||||
value: 0
|
value: 0
|
||||||
type: coins
|
type: coins
|
||||||
display: "&a$%value%"
|
display: "&a$%value%"
|
||||||
|
|
||||||
|
leave-lore:
|
||||||
|
- ""
|
||||||
|
|
||||||
level-xp-requirements:
|
level-xp-requirements:
|
||||||
- 100
|
- 100
|
||||||
- 120
|
- 120
|
||||||
|
|||||||
Reference in New Issue
Block a user