com.skillw.attsystem.internal.manager.CompileManagerImpl.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of AttributeSystem Show documentation
Show all versions of AttributeSystem Show documentation
Bukkit Attribute Engine Plugin.
The newest version!
package com.skillw.attsystem.internal.manager
import com.skillw.attsystem.AttributeSystem
import com.skillw.attsystem.api.attribute.compound.AttributeData
import com.skillw.attsystem.api.compiled.sub.ComplexCompiledData
import com.skillw.attsystem.api.compiled.sub.NBTCompiledData
import com.skillw.attsystem.api.compiled.sub.StringsCompiledData
import com.skillw.attsystem.api.manager.CompileManager
import com.skillw.pouvoir.Pouvoir.conditionManager
import org.bukkit.entity.LivingEntity
object CompileManagerImpl : CompileManager() {
override val key = "CompileManager"
override val priority: Int = 7
override val subPouvoir = AttributeSystem
override fun compile(
entity: LivingEntity?,
nbt: Collection,
slot: String?,
): (MutableMap) -> NBTCompiledData {
return { attrDataMap ->
val total = NBTCompiledData(attrDataMap)
for (condCompound in nbt) {
condCompound as? Map ?: continue
val paths = condCompound["paths"] as? List ?: continue
val entry = NBTCompiledData.Entry(paths)
val conditions = condCompound["conditions"] as? List