com.skillw.attsystem.internal.feature.compat.mythicmobs.common.DataUpdateV.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.feature.compat.mythicmobs.common
import com.skillw.attsystem.api.AttrAPI.updateAttr
import com.skillw.pouvoir.util.isAlive
import io.lumine.mythic.api.skills.INoTargetSkill
import io.lumine.mythic.api.skills.SkillMetadata
import io.lumine.mythic.api.skills.SkillResult
import io.lumine.mythic.core.logging.MythicLogger
import org.bukkit.entity.LivingEntity
import taboolib.module.nms.getI18nName
/**
* @className AttributeDamageIV
*
* @author Glom
* @date 2022/7/11 17:14 Copyright 2022 user. All rights reserved.
*/
internal object DataUpdateV : INoTargetSkill {
override fun cast(data: SkillMetadata): SkillResult {
val target = data.caster.entity.bukkitEntity
if (target !is LivingEntity || !target.isAlive()) return SkillResult.CONDITION_FAILED
target.updateAttr()
MythicLogger.debug(
MythicLogger.DebugLevel.MECHANIC,
"+ DataUpdate Mechanic fired for {0}",
target.getI18nName()
)
return SkillResult.SUCCESS
}
}