public class EntityAIMate extends EntityAIBase
Modifier and Type | Field and Description |
---|---|
(package private) double |
moveSpeed
The speed the creature moves at during mating behavior.
|
(package private) int |
spawnBabyDelay
Delay preventing a baby from spawning immediately when two mate-able animals find each other.
|
private EntityAnimal |
targetMate |
private EntityAnimal |
theAnimal |
(package private) World |
theWorld |
Constructor and Description |
---|
EntityAIMate(EntityAnimal animal,
double speedIn) |
Modifier and Type | Method and Description |
---|---|
boolean |
continueExecuting()
Returns whether an in-progress EntityAIBase should continue executing
|
private EntityAnimal |
getNearbyMate()
Loops through nearby animals and finds another animal of the same type that can be mated with.
|
void |
resetTask()
Resets the task
|
boolean |
shouldExecute()
Returns whether the EntityAIBase should begin execution.
|
private void |
spawnBaby()
Spawns a baby animal of the same type.
|
void |
updateTask()
Updates the task
|
getMutexBits, isInterruptible, setMutexBits, startExecuting
private EntityAnimal theAnimal
World theWorld
private EntityAnimal targetMate
int spawnBabyDelay
double moveSpeed
public EntityAIMate(EntityAnimal animal, double speedIn)
public boolean shouldExecute()
shouldExecute
in class EntityAIBase
public boolean continueExecuting()
continueExecuting
in class EntityAIBase
public void resetTask()
resetTask
in class EntityAIBase
public void updateTask()
updateTask
in class EntityAIBase
private EntityAnimal getNearbyMate()
private void spawnBaby()