All Downloads are FREE. Search and download functionalities are using the official Maven repository.

walkmc.Behavior.kt Maven / Gradle / Ivy

There is a newer version: 2.4.0
Show newest version
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