This commit is contained in:
Auxilor 2022-10-04 12:32:30 +01:00
parent 6f4ad07511
commit 8bb14aa86a
3 changed files with 12 additions and 4 deletions

View File

@ -58,9 +58,14 @@ internal object AllEnchantmentTarget : EnchantmentTarget {
override val id = "all"
override val displayName = EcoEnchantsPlugin.instance.langYml.getFormattedString("all")
override val slot = TargetSlot.ANY
override val items = EnchantmentTargets.values()
.filterNot { it == this }
.flatMap { it.items }
override var items = emptyList<TestableItem>()
private set
fun updateItems() {
items = EnchantmentTargets.values()
.filterNot { it == this }
.flatMap { it.items }
}
override fun equals(other: Any?): Boolean {
return other is AllEnchantmentTarget

View File

@ -74,6 +74,8 @@ object EnchantmentTargets {
for (config in plugin.targetsYml.getSubsections("targets")) {
ConfiguredEnchantmentTarget(config)
}
AllEnchantmentTarget.updateItems()
}
/**

View File

@ -7,7 +7,8 @@ placeholders:
targets:
- all
conflicts: [ ]
conflicts:
- mending
rarity: veryspecial
max-level: 3