com.skillw.pouvoir.api.feature.selector.target.LocTarget.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.
package com.skillw.pouvoir.api.feature.selector.target
import com.skillw.pouvoir.api.feature.selector.Target
import org.bukkit.Location
import org.bukkit.entity.Entity
import org.bukkit.entity.LivingEntity
/**
* @className EntityTarget
*
* @author Glom
* @date 2023/1/9 7:36 Copyright 2024 Glom.
*/
open class LocTarget(location: Location) : Target("LocTarget$$location", location) {
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other !is LocTarget) return false
if (location != other.location) return false
return true
}
override fun hashCode(): Int {
return location.hashCode()
}
override fun toString(): String {
return "LocTarget(loc=$location)"
}
companion object {
fun Entity.targetLoc(): Location {
return if (this is LivingEntity) eyeLocation.clone() else location.clone()
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy