示例#1
0
 @Override
 public boolean continueExecuting() {
   return !thePathfinder.noPath()
       && theRobit.getDistanceSqToEntity(theOwner) > (maxDist * maxDist)
       && theRobit.getFollowing()
       && theRobit.getEnergy() > 0
       && theOwner.worldObj.provider.dimensionId == theRobit.worldObj.provider.dimensionId;
 }
示例#2
0
  @Override
  public boolean shouldExecute() {
    EntityPlayer player = theRobit.getOwner();

    if (player == null) {
      return false;
    } else if (theRobit.worldObj.provider.dimensionId != player.worldObj.provider.dimensionId) {
      return false;
    } else if (!theRobit.getFollowing()) {
      // Still looks up at the player if on chargepad or not following

      theRobit
          .getLookHelper()
          .setLookPositionWithEntity(player, 6.0F, theRobit.getVerticalFaceSpeed() / 10);
      return false;
    } else if (theRobit.getDistanceSqToEntity(player) < (minDist * minDist)) {
      return false;
    } else if (theRobit.getEnergy() == 0) {
      return false;
    } else {
      theOwner = player;
      return true;
    }
  }