mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-21 14:55:17 +01:00
One day I'll rewrite EnchantLookup.kt
This commit is contained in:
parent
5609c6eec2
commit
0d5f830192
@ -63,12 +63,19 @@ class EcoEnchantsPlugin : LibreforgePlugin() {
|
||||
override fun handleEnable() {
|
||||
registerHolderProvider { it.heldEnchantLevels }
|
||||
registerPlayerRefreshFunction { it.clearEnchantCache() }
|
||||
|
||||
registerHolderPlaceholderProvider<FoundEcoEnchantLevel> { it, _ ->
|
||||
listOf(
|
||||
NamedValue("level", it.level.level),
|
||||
NamedValue("active_level", it.activeLevel)
|
||||
)
|
||||
}
|
||||
|
||||
registerHolderPlaceholderProvider<EcoEnchantLevel> { it, _ ->
|
||||
listOf(
|
||||
NamedValue("level", it.level),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun handleAfterLoad() {
|
||||
|
@ -308,7 +308,7 @@ object EnchantLookup {
|
||||
|
||||
// This is such a fucking disgusting way of implementing %active_level%,
|
||||
// and it's probably quite slow too.
|
||||
return if (EcoEnchantsPlugin.instance.configYml.getBool("internal-placeholders.active-level")) {
|
||||
return if (EcoEnchantsPlugin.instance.configYml.getBool("extra-placeholders.active-level")) {
|
||||
found.map {
|
||||
val level = it.holder as EcoEnchantLevel
|
||||
|
||||
|
@ -167,6 +167,8 @@ lore-conversion:
|
||||
enabled: false # If lore conversion should be enabled
|
||||
aggressive: false # Will convert all items in all inventories when opened, likely to use a lot of performance
|
||||
|
||||
#Options for enable or disable placeholders of EcoEnchants
|
||||
internal-placeholders:
|
||||
active-level: true # Enable or disable %active_level% placeholder. Can be disabled to save some cpu time, if you don't use this placeholder
|
||||
# Extra placeholders for enchantment configs
|
||||
extra-placeholders:
|
||||
# Enable or disable %active_level% placeholder.
|
||||
# It's disabled by default to save CPU time, enable if you want to use it.
|
||||
active-level: false
|
Loading…
Reference in New Issue
Block a user