
walkmc.Behavior.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of walk-server Show documentation
Show all versions of walk-server Show documentation
A spigot fork to kotlin structure and news.
package walkmc
import net.minecraft.server.*
import org.bukkit.entity.Entity
/**
* A abstract pathfinder to create new pathfinders goals. This contains
* the name functions not obfuscated, so, is easy to know what the function do.
*/
abstract class Behavior(val insentient: EntityInsentient) : PathfinderGoal() {
val entity: Entity = insentient.bukkitEntity
constructor(entity: Entity) : this(entity as EntityInsentient)
/**
* Verifies if this pathfinder can executes.
*/
abstract fun canExecute(): Boolean
/**
* Verifies if this pathfinder can continues executing.
*/
abstract fun canContinue(): Boolean
/**
* Startups this pathfinder goal.
*/
abstract fun startup()
/**
* Shutdown this pathfinder goal.
*/
abstract fun shutdown()
/**
* Execute the pathfinder goal.
*/
abstract fun execute()
override fun a(): Boolean = canExecute()
override fun b(): Boolean = canContinue()
override fun c() = startup()
override fun d() = shutdown()
override fun e() = execute()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy