com.skillw.pouvoir.internal.manager.ConditionManagerImpl.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Pouvoir Show documentation
Show all versions of Pouvoir Show documentation
Bukkit Script Engine Plugin.
The newest version!
package com.skillw.pouvoir.internal.manager
import com.skillw.pouvoir.Pouvoir
import com.skillw.pouvoir.api.feature.condition.ConditionData
import com.skillw.pouvoir.api.manager.sub.ConditionManager
import com.skillw.pouvoir.util.clone
object ConditionManagerImpl : ConditionManager() {
override val key = "ConditionManager"
override val priority: Int = 7
override val subPouvoir = Pouvoir
override fun onEnable() {
onReload()
}
override fun onReload() {
this.entries.filter { it.value.release }.forEach { this.remove(it.key) }
}
override fun matchConditions(text: String, slot: String?): Collection =
ArrayList().apply {
values.forEach { condition ->
condition.parameters(text)?.let {
this += ConditionData(condition).push(HashMap(it).apply { put("slot", slot) })
}
}
}
override fun matchConditions(conditions: List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy