Merge pull request #26

Add %boosters_active_list% placeholder
This commit is contained in:
Will FP
2022-06-20 14:05:27 +01:00
committed by GitHub
2 changed files with 21 additions and 0 deletions

View File

@@ -196,6 +196,26 @@ class Booster(
"${hh}:${mm}:${ss}"
}
)
PlaceholderManager.registerPlaceholder(
PlayerlessPlaceholder(
plugin,
"active_list",
) {
var activeList = mutableListOf<String>()
for(active in Bukkit.getServer().activeBoosters){
activeList.add(active.booster.name)
}
var outputString = plugin.langYml.getString("no-currently-active-list").formatEco(formatPlaceholders = false)
if (activeList.size > 0) {
outputString = activeList.joinToString(", ")
}
outputString
}
)
}
override fun equals(other: Any?): Boolean {

View File

@@ -18,4 +18,5 @@ messages:
cannot-transmit: "&cYou can't transmit here!"
no-currently-active: "&cNot Active!"
no-currently-active-list: "&cThere isn't any booster active!"
active-placeholder: "&fThanks %player% &ffor activating %booster%&f!"