Class EntityBreedingExecutor<T extends EntityAnimal>

java.lang.Object
cn.nukkit.entity.ai.executor.EntityBreedingExecutor<T>
All Implemented Interfaces:
IBehaviorExecutor

@PowerNukkitXOnly @Since("1.6.0.0-PNX") public class EntityBreedingExecutor<T extends EntityAnimal> extends Object implements IBehaviorExecutor
  • Field Details

    • entityClass

      protected Class<T extends EntityAnimal> entityClass
    • findingRangeSquared

      protected int findingRangeSquared
    • duration

      protected int duration
    • currentTick

      protected int currentTick
    • moveSpeed

      protected float moveSpeed
    • finded

      protected boolean finded
    • another

      protected T extends EntityAnimal another
  • Constructor Details

    • EntityBreedingExecutor

      public EntityBreedingExecutor(Class<T> entityClass, int findingRangeSquared, int duration, float moveSpeed)
  • Method Details

    • execute

      public boolean execute(EntityIntelligent uncasted)
      Description copied from interface: IBehaviorExecutor
      调度器将会持续执行此执行器,直到返回false,或者执行器被中断
      此方法每gt都会调用
      Specified by:
      execute in interface IBehaviorExecutor
      Parameters:
      uncasted - 执行目标实体
      Returns:
      boolean
    • onInterrupt

      public void onInterrupt(EntityIntelligent entity)
      Description copied from interface: IBehaviorExecutor
      行为非正常中断时(例如被更高级行为覆盖)调用
      Specified by:
      onInterrupt in interface IBehaviorExecutor
      Parameters:
      entity - 目标实体
    • setSpouse

      protected void setSpouse(T entity1, T entity2)
    • clearData

      protected void clearData(T entity)
    • updateMove

      protected void updateMove(T entity1, T entity2)
    • getNearestInLove

      @Nullable protected T getNearestInLove(EntityIntelligent entity)
    • shouldFindingSpouse

      protected boolean shouldFindingSpouse(T entity)
    • bear

      protected void bear(T entity1, T entity2)